-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bump up minor * add useJsonSchema param * add example file * add new module * fix * add isOption field * add jsony library * wip parser * code format * del: nim 1.0, 1.2 * fix test * format code * add disableOption param * format code * fix: headUper function move to utils.nim * fix: format code * fix: use headUpper * fix: add newNilTypeObjectDefinition * fix: format code * fix * fix: format code * WIP: add testcode * fix: format code * wip * fix: format code * format code * format code * fix: support nested object * fix: bump up major * fix: typeToNimType * format code * fix: add JsonSchemaParser * format code * fix: add $ref validation * format code * feat: support $ref and $defs * format code * feat: support $ref primitive type * format code * feat: activate JSON Schema in CLI * chore: delete unused import * format code * add: sample json schema file * chore: write JSON Schema usage * chore: fix section titles * small fix * fix sample code * add api usage * format code * fix cli help message * add doc comment * change disableOption to disableOptionType * add examle code * fix help * fix link
- Loading branch information
Showing
12 changed files
with
718 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,6 @@ jobs: | |
os: | ||
- ubuntu-latest | ||
nim-version: | ||
- '1.0.x' | ||
- '1.2.x' | ||
- '1.4.x' | ||
- '1.6.x' | ||
- 'stable' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://nats.io/schemas/jetstream/advisory/v1/nak.json", | ||
"description": "Advisory published when a message was naked using a AckNak acknowledgement", | ||
"title": "io.nats.jetstream.advisory.v1.nak", | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"id", | ||
"timestamp", | ||
"stream", | ||
"consumer", | ||
"consumer_seq", | ||
"stream_seq", | ||
"deliveries" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"const": "io.nats.jetstream.advisory.v1.nak" | ||
}, | ||
"id": { | ||
"type": "string", | ||
"description": "Unique correlation ID for this event" | ||
}, | ||
"timestamp": { | ||
"type": "string", | ||
"description": "The time this event was created in RFC3339 format" | ||
}, | ||
"stream": { | ||
"type": "string", | ||
"description": "The name of the stream where the message is stored" | ||
}, | ||
"consumer": { | ||
"type": "string", | ||
"description": "The name of the consumer where the message was naked" | ||
}, | ||
"consumer_seq": { | ||
"type": "string", | ||
"minimum": 1, | ||
"description": "The sequence of the message in the consumer that was naked" | ||
}, | ||
"stream_seq": { | ||
"type": "string", | ||
"minimum": 1, | ||
"description": "The sequence of the message in the stream that was naked" | ||
}, | ||
"deliveries": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"description": "The number of deliveries that were attempted" | ||
}, | ||
"domain": { | ||
"type": "string", | ||
"minimum": 1, | ||
"description": "The domain of the JetStreamServer" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$id": "https://example.com/product.schema.json", | ||
"type": "object", | ||
"properties": { | ||
"product": { "$ref": "#/$defs/product" }, | ||
"product2": { "$ref": "#/$defs/product2" } | ||
}, | ||
"$defs": { | ||
"product": { "type": "string" }, | ||
"product2": { "type": "array", "items": { "type": "string" } } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import nimjson | ||
import json | ||
|
||
echo """{"keyStr":"str", "keyInt":1}""".parseJson().toTypeString() | ||
echo "../primitive.json".parseFile().toTypeString("testObject") | ||
echo """{"keyStr":"str", "keyInt":1}""".toTypeString() | ||
echo "../primitive.json".readFile().toTypeString("testObject") | ||
echo "../json_schema.json".readFile().toTypeString("testObject", | ||
jsonSchema = true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.