-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: perform schema formatting with the new JSON Schema CLI
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
Showing
58 changed files
with
1,622 additions
and
1,430 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 |
---|---|---|
@@ -1,45 +1,45 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json", | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"name", | ||
"in" | ||
], | ||
"properties": { | ||
"description": { | ||
"description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"description": "The type of the security scheme.", | ||
"type": "string", | ||
"enum": [ | ||
"httpApiKey" | ||
] | ||
}, | ||
"name": { | ||
"type": "string", | ||
"description": "The name of the header, query or cookie parameter to be used." | ||
}, | ||
"in": { | ||
"type": "string", | ||
"description": "The location of the API key", | ||
"type": "string", | ||
"enum": [ | ||
"header", | ||
"query", | ||
"cookie" | ||
] | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." | ||
"name": { | ||
"description": "The name of the header, query or cookie parameter to be used.", | ||
"type": "string" | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"example": { | ||
"$ref": "http://asyncapi.com/examples/3.0.0/APIKeyHTTPSecurityScheme.json" | ||
}, | ||
"additionalProperties": false, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json" | ||
} | ||
} | ||
} |
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,39 +1,39 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json", | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"scheme" | ||
], | ||
"properties": { | ||
"scheme": { | ||
"description": { | ||
"description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "The type of the security scheme.", | ||
"type": "string", | ||
"description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", | ||
"enum": [ | ||
"bearer" | ||
"http" | ||
] | ||
}, | ||
"bearerFormat": { | ||
"type": "string", | ||
"description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." | ||
"description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"scheme": { | ||
"description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", | ||
"type": "string", | ||
"description": "The type of the security scheme.", | ||
"enum": [ | ||
"http" | ||
"bearer" | ||
] | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json" | ||
} | ||
"additionalProperties": false | ||
} |
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 |
---|---|---|
@@ -1,44 +1,44 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json", | ||
"type": "object", | ||
"not": { | ||
"type": "object", | ||
"properties": { | ||
"scheme": { | ||
"type": "string", | ||
"description": "A short description for security scheme.", | ||
"type": "string", | ||
"enum": [ | ||
"bearer" | ||
] | ||
} | ||
} | ||
}, | ||
"type": "object", | ||
"required": [ | ||
"scheme", | ||
"type" | ||
], | ||
"properties": { | ||
"scheme": { | ||
"type": "string", | ||
"description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "A short description for security scheme." | ||
"description": "A short description for security scheme.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"description": "The type of the security scheme.", | ||
"type": "string", | ||
"enum": [ | ||
"http" | ||
] | ||
}, | ||
"scheme": { | ||
"description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", | ||
"type": "string" | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json" | ||
} | ||
"additionalProperties": false | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"type": "string", | ||
"format": "uri-reference", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" | ||
} | ||
"$id": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json", | ||
"type": "string", | ||
"format": "uri-reference" | ||
} |
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,30 +1,30 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json", | ||
"type": "object", | ||
"required": [ | ||
"type" | ||
], | ||
"properties": { | ||
"description": { | ||
"description": "A short description for security scheme.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"description": "The type of the security scheme.", | ||
"type": "string", | ||
"enum": [ | ||
"gssapi" | ||
] | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "A short description for security scheme." | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"example": { | ||
"$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" | ||
}, | ||
"additionalProperties": false, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json" | ||
} | ||
"example": { | ||
"$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" | ||
} | ||
} |
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,30 +1,30 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json", | ||
"type": "object", | ||
"required": [ | ||
"type" | ||
], | ||
"properties": { | ||
"description": { | ||
"description": "A short description for security scheme.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"description": "The type of the security scheme. Valid values", | ||
"type": "string", | ||
"enum": [ | ||
"plain" | ||
] | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "A short description for security scheme." | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"example": { | ||
"$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" | ||
}, | ||
"additionalProperties": false, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json" | ||
} | ||
} |
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,31 +1,31 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json", | ||
"type": "object", | ||
"required": [ | ||
"type" | ||
], | ||
"properties": { | ||
"description": { | ||
"description": "A short description for security scheme.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"description": "The type of the security scheme.", | ||
"type": "string", | ||
"enum": [ | ||
"scramSha256", | ||
"scramSha512" | ||
] | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "A short description for security scheme." | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"example": { | ||
"$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" | ||
}, | ||
"additionalProperties": false, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json" | ||
} | ||
} |
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
Oops, something went wrong.