Skip to content

Commit

Permalink
update comments, fix numbers using sed
Browse files Browse the repository at this point in the history
Signed-off-by: R.I.Pienaar <[email protected]>
  • Loading branch information
ripienaar committed Jul 21, 2021
1 parent 72cb829 commit 2cac9ca
Show file tree
Hide file tree
Showing 27 changed files with 373 additions and 309 deletions.
4 changes: 3 additions & 1 deletion compile_schemas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ dereference_directory () {

if [[ "${file: -5}" == ".json" ]];then
json-dereference -s "${file}" -o "${target_dir}/${file}.temp.json"
jq < "${target_dir}/${file}.temp.json" > "${target_dir}/${file}"

# seds here is because go uint64 is too big for node and some overflows/confusion happen, so we put it back how it should be :(
jq < "${target_dir}/${file}.temp.json" |sed -e s/9223372036854776000/9223372036854775807/ | sed -e s/18446744073709552000/18446744073709551615/ > "${target_dir}/${file}"
rm -f "${target_dir}/${file}.temp.json"
fi
done
Expand Down
5 changes: 2 additions & 3 deletions schema_source/jetstream/api/v1/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
"type": "object",
"definitions": {
"golang_duration_nanos": {
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"$ref": "#/definitions/golang_int64"
},
"golang_int": {
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"minimum": -9223372036854775808,
"maximum": 9223372036854775807
"$ref": "#/definitions/golang_int64"
},
"golang_uint64": {
"$comment": "unsigned 64 bit integer",
Expand Down
25 changes: 14 additions & 11 deletions schemas/jetstream/api/v1/consumer_configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"minimum": 0,
"$comment": "unsigned 64 bit integer",
"type": "integer",
"maximum": 18446744073709552000
"maximum": 18446744073709551615
}
}
},
Expand Down Expand Up @@ -113,15 +113,16 @@
"ack_wait": {
"description": "How long (in nanoseconds) to allow messages to remain un-acknowledged before attempting redelivery",
"minimum": 1,
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"type": "integer",
"maximum": 9223372036854776000
"maximum": 9223372036854775807
},
"max_deliver": {
"description": "The number of times a message will be redelivered to consumers if not acknowledged in time",
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"minimum": -9223372036854776000,
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807,
"minimum": -9223372036854775807
},
"filter_subject": {
"type": "string"
Expand All @@ -141,20 +142,21 @@
"minimum": 0,
"$comment": "unsigned 64 bit integer",
"type": "integer",
"maximum": 18446744073709552000
"maximum": 18446744073709551615
},
"max_ack_pending": {
"description": "The maximum number of messages without acknowledgement that can be outstanding, once this limit is reached message delivery will be suspended",
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"minimum": -9223372036854776000,
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807,
"minimum": -9223372036854775807
},
"idle_heartbeat": {
"minimum": 0,
"description": "If the Consumer is idle for more than this many nano seconds a empty message with Status header 100 will be sent indicating the consumer is still alive",
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"type": "integer",
"maximum": 9223372036854776000
"maximum": 9223372036854775807
},
"flow_control": {
"type": "boolean",
Expand All @@ -165,7 +167,8 @@
"minimum": 0,
"default": 512,
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807
},
"direct": {
"type": "boolean",
Expand Down
25 changes: 14 additions & 11 deletions schemas/jetstream/api/v1/consumer_create_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"minimum": 0,
"$comment": "unsigned 64 bit integer",
"type": "integer",
"maximum": 18446744073709552000
"maximum": 18446744073709551615
}
}
},
Expand Down Expand Up @@ -125,15 +125,16 @@
"ack_wait": {
"description": "How long (in nanoseconds) to allow messages to remain un-acknowledged before attempting redelivery",
"minimum": 1,
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"type": "integer",
"maximum": 9223372036854776000
"maximum": 9223372036854775807
},
"max_deliver": {
"description": "The number of times a message will be redelivered to consumers if not acknowledged in time",
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"minimum": -9223372036854776000,
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807,
"minimum": -9223372036854775807
},
"filter_subject": {
"type": "string"
Expand All @@ -153,20 +154,21 @@
"minimum": 0,
"$comment": "unsigned 64 bit integer",
"type": "integer",
"maximum": 18446744073709552000
"maximum": 18446744073709551615
},
"max_ack_pending": {
"description": "The maximum number of messages without acknowledgement that can be outstanding, once this limit is reached message delivery will be suspended",
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"minimum": -9223372036854776000,
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807,
"minimum": -9223372036854775807
},
"idle_heartbeat": {
"minimum": 0,
"description": "If the Consumer is idle for more than this many nano seconds a empty message with Status header 100 will be sent indicating the consumer is still alive",
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"type": "integer",
"maximum": 9223372036854776000
"maximum": 9223372036854775807
},
"flow_control": {
"type": "boolean",
Expand All @@ -177,7 +179,8 @@
"minimum": 0,
"default": 512,
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807
},
"direct": {
"type": "boolean",
Expand Down
44 changes: 25 additions & 19 deletions schemas/jetstream/api/v1/consumer_create_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"minimum": 0,
"$comment": "unsigned 64 bit integer",
"type": "integer",
"maximum": 18446744073709552000
"maximum": 18446744073709551615
}
}
},
Expand Down Expand Up @@ -141,15 +141,16 @@
"ack_wait": {
"description": "How long (in nanoseconds) to allow messages to remain un-acknowledged before attempting redelivery",
"minimum": 1,
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"type": "integer",
"maximum": 9223372036854776000
"maximum": 9223372036854775807
},
"max_deliver": {
"description": "The number of times a message will be redelivered to consumers if not acknowledged in time",
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"minimum": -9223372036854776000,
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807,
"minimum": -9223372036854775807
},
"filter_subject": {
"type": "string"
Expand All @@ -169,20 +170,21 @@
"minimum": 0,
"$comment": "unsigned 64 bit integer",
"type": "integer",
"maximum": 18446744073709552000
"maximum": 18446744073709551615
},
"max_ack_pending": {
"description": "The maximum number of messages without acknowledgement that can be outstanding, once this limit is reached message delivery will be suspended",
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"minimum": -9223372036854776000,
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807,
"minimum": -9223372036854775807
},
"idle_heartbeat": {
"minimum": 0,
"description": "If the Consumer is idle for more than this many nano seconds a empty message with Status header 100 will be sent indicating the consumer is still alive",
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"type": "integer",
"maximum": 9223372036854776000
"maximum": 9223372036854775807
},
"flow_control": {
"type": "boolean",
Expand All @@ -193,7 +195,8 @@
"minimum": 0,
"default": 512,
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807
},
"direct": {
"type": "boolean",
Expand All @@ -219,14 +222,14 @@
"$comment": "unsigned 64 bit integer",
"type": "integer",
"minimum": 0,
"maximum": 18446744073709552000
"maximum": 18446744073709551615
},
"stream_seq": {
"description": "The sequence number of the Stream",
"$comment": "unsigned 64 bit integer",
"type": "integer",
"minimum": 0,
"maximum": 18446744073709552000
"maximum": 18446744073709551615
}
}
},
Expand All @@ -244,41 +247,44 @@
"$comment": "unsigned 64 bit integer",
"type": "integer",
"minimum": 0,
"maximum": 18446744073709552000
"maximum": 18446744073709551615
},
"stream_seq": {
"description": "The sequence number of the Stream",
"$comment": "unsigned 64 bit integer",
"type": "integer",
"minimum": 0,
"maximum": 18446744073709552000
"maximum": 18446744073709551615
}
}
},
"num_ack_pending": {
"description": "The number of messages pending acknowledgement",
"minimum": 0,
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807
},
"num_redelivered": {
"description": "The number of redeliveries that have been performed",
"minimum": 0,
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807
},
"num_waiting": {
"description": "The number of pull consumers waiting for messages",
"minimum": 0,
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"maximum": 9223372036854776000
"type": "integer",
"maximum": 9223372036854775807
},
"num_pending": {
"description": "The number of messages left unconsumed in this Consumer",
"minimum": 0,
"$comment": "unsigned 64 bit integer",
"type": "integer",
"maximum": 18446744073709552000
"maximum": 18446744073709551615
},
"cluster": {
"type": "object",
Expand Down
9 changes: 5 additions & 4 deletions schemas/jetstream/api/v1/consumer_getnext_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
"properties": {
"expires": {
"description": "A duration from now when the pull should expire, stated in nanoseconds, 0 for no expiry",
"$comment": "nanoseconds depicting a duration in time",
"$comment": "nanoseconds depicting a duration in time, signed 64 bit integer",
"type": "integer",
"maximum": 9223372036854776000,
"minimum": -9223372036854776000
"maximum": 9223372036854775807,
"minimum": -9223372036854775807
},
"batch": {
"description": "How many messages the server should deliver to the requestor",
"minimum": 0,
"maximum": 256,
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit"
"$comment": "integer with a dynamic bit size depending on the platform the cluster runs on, can be up to 64bit",
"type": "integer"
},
"no_wait": {
"type": "boolean",
Expand Down
Loading

0 comments on commit 2cac9ca

Please sign in to comment.