Skip to content

Commit

Permalink
Integrate with the Intelligence.AI JSON Schema CLI for formatting
Browse files Browse the repository at this point in the history
Hey there from a JSON Schema TSC and ex-Postman! We are developing an
open-source CLI (https://github.com/intelligence-ai/jsonschema)
specifically targeted at helping maintain repositories of schemas, just
like this one. The idea is to make it super smooth to work with schemas.

The tool is already capable of doing formatting, linting (which revals a
couple of issues already in this repo), testing, bundling, and more,
which can replace a few of the tools and scripts you already have here.

Instead of sending a big PR, here is a small one just making use of
formatting. The formatting implementation will re-organize keywords in a
schema to make them easier to read. For example, bumping `$schema` to
the top, ensuring consistent, indentation, etc.

If you like it, I'd love to continue working together to integrate more
things, like the linter, the schema test framework, etc.

Let me know what you think and if you have any requirement or idea,
please let me know and we'll happily implement it for you! We want to
make it super smooth to maintain repos like this one, so any feedback is
very welcomed!

Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Jun 11, 2024
1 parent d83cc02 commit c9b248c
Show file tree
Hide file tree
Showing 634 changed files with 14,957 additions and 14,649 deletions.
207 changes: 110 additions & 97 deletions bindings/amqp/0.2.0/channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,134 +3,147 @@
"$id": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json",
"title": "AMQP channel bindings object",
"description": "This object contains information about the channel representation in AMQP.",
"examples": [
{
"bindingVersion": "0.2.0",
"exchange": {
"type": "topic",
"autoDelete": false,
"durable": true,
"name": "myExchange",
"vhost": "/"
},
"is": "routingKey"
},
{
"bindingVersion": "0.2.0",
"is": "queue",
"queue": {
"autoDelete": false,
"durable": true,
"exclusive": true,
"name": "my-queue-name",
"vhost": "/"
}
}
],
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
"oneOf": [
{
"not": {
"required": [
"queue"
]
},
"required": [
"exchange"
],
"properties": {
"is": {
"const": "routingKey"
}
}
},
{
"not": {
"required": [
"exchange"
]
},
"required": [
"queue"
],
"properties": {
"is": {
"const": "queue"
}
}
}
},
],
"properties": {
"is": {
"bindingVersion": {
"description": "The version of this binding. If omitted, 'latest' MUST be assumed.",
"type": "string",
"enum": ["queue", "routingKey"],
"description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)."
"enum": [
"0.2.0"
]
},
"exchange": {
"description": "When is=routingKey, this object defines the exchange properties.",
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"description": "The name of the exchange. It MUST NOT exceed 255 characters long."
},
"type": {
"description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'.",
"type": "string",
"enum": ["topic", "direct", "fanout", "default", "headers"],
"description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'."
"enum": [
"topic",
"direct",
"fanout",
"default",
"headers"
]
},
"autoDelete": {
"description": "Whether the exchange should be deleted when the last queue is unbound from it.",
"type": "boolean"
},
"durable": {
"type": "boolean",
"description": "Whether the exchange should survive broker restarts or not."
"description": "Whether the exchange should survive broker restarts or not.",
"type": "boolean"
},
"autoDelete": {
"type": "boolean",
"description": "Whether the exchange should be deleted when the last queue is unbound from it."
"name": {
"description": "The name of the exchange. It MUST NOT exceed 255 characters long.",
"type": "string",
"maxLength": 255
},
"vhost": {
"type": "string",
"description": "The virtual host of the exchange. Defaults to '/'.",
"default": "/",
"description": "The virtual host of the exchange. Defaults to '/'."
"type": "string"
}
},
"description": "When is=routingKey, this object defines the exchange properties."
}
},
"is": {
"description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default).",
"type": "string",
"enum": [
"queue",
"routingKey"
]
},
"queue": {
"description": "When is=queue, this object defines the queue properties.",
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"description": "The name of the queue. It MUST NOT exceed 255 characters long."
"autoDelete": {
"description": "Whether the queue should be deleted when the last consumer unsubscribes.",
"type": "boolean"
},
"durable": {
"type": "boolean",
"description": "Whether the queue should survive broker restarts or not."
"description": "Whether the queue should survive broker restarts or not.",
"type": "boolean"
},
"exclusive": {
"type": "boolean",
"description": "Whether the queue should be used only by one connection or not."
"description": "Whether the queue should be used only by one connection or not.",
"type": "boolean"
},
"autoDelete": {
"type": "boolean",
"description": "Whether the queue should be deleted when the last consumer unsubscribes."
"name": {
"description": "The name of the queue. It MUST NOT exceed 255 characters long.",
"type": "string",
"maxLength": 255
},
"vhost": {
"type": "string",
"description": "The virtual host of the queue. Defaults to '/'.",
"default": "/",
"description": "The virtual host of the queue. Defaults to '/'."
"type": "string"
}
},
"description": "When is=queue, this object defines the queue properties."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.2.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}
},
"oneOf": [
{
"properties": {
"is": { "const": "routingKey" }
},
"required": [
"exchange"
],
"not": {
"required": [
"queue"
]
}
},
{
"properties": {
"is": { "const": "queue" }
},
"required": [
"queue"
],
"not": {
"required": [
"exchange"
]
}
}
],
"examples": [
{
"is": "routingKey",
"exchange": {
"name": "myExchange",
"type": "topic",
"durable": true,
"autoDelete": false,
"vhost": "/"
},
"bindingVersion": "0.2.0"
},
{
"is": "queue",
"queue": {
"name": "my-queue-name",
"durable": true,
"exclusive": true,
"autoDelete": false,
"vhost": "/"
},
"bindingVersion": "0.2.0"
},
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
]
},
"additionalProperties": false
}
40 changes: 20 additions & 20 deletions bindings/amqp/0.2.0/message.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
"$id": "http://asyncapi.com/bindings/amqp/0.2.0/message.json",
"title": "AMQP message bindings object",
"description": "This object contains information about the message representation in AMQP.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
"examples": [
{
"contentEncoding": "gzip",
"bindingVersion": "0.2.0",
"messageType": "user.signup"
}
},
],
"type": "object",
"properties": {
"contentEncoding": {
"type": "string",
"description": "A MIME encoding for the message content."
},
"messageType": {
"type": "string",
"description": "Application-specific message type."
"description": "A MIME encoding for the message content.",
"type": "string"
},
"bindingVersion": {
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed.",
"type": "string",
"enum": [
"0.2.0"
],
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed."
]
},
"messageType": {
"description": "Application-specific message type.",
"type": "string"
}
},
"examples": [
{
"contentEncoding": "gzip",
"messageType": "user.signup",
"bindingVersion": "0.2.0"
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
]
},
"additionalProperties": false
}
Loading

0 comments on commit c9b248c

Please sign in to comment.