-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: allow multi format schemas #370
Merged
asyncapi-bot
merged 17 commits into
asyncapi:next-major-spec
from
smoya:feat/allowSchemas
Jul 13, 2023
Merged
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
148d087
feat!: allow defining message schemaFormat at message level
smoya 7c0702e
Merge branch 'next-major-spec' into feat/allowSchemas
smoya bfa04f3
Merge branch 'next-major-spec' into feat/allowSchemas
smoya 359b935
renaming + adding to components
smoya a92fc1e
update tests
smoya 9359ece
remove schemaFormat from messageTrait + fix oneOf for message payload
smoya 890615d
add anySchema.json wrapper
smoya 0922bbc
Merge branch 'next-major-spec' into feat/allowSchemas
smoya 0a58398
add compiled schema
smoya b0b5133
add support for headers
smoya cacbbce
fix components schemas + review issues
smoya be4bb63
allow reference in componentes schemas
smoya bf316fa
simplify if/else adding the then
smoya 266fd07
allow no objects to be schemas
smoya bb91012
Merge remote-tracking branch 'origin/next-major-spec' into feat/allow…
smoya 1826d4c
update 3.0.0-without-.json
smoya a0823b1
remove allOf as non-needed
smoya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,147 @@ | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"properties": { | ||
"schemaFormat": { | ||
"type": "string" | ||
}, | ||
"schema": {} | ||
}, | ||
"allOf": [ | ||
{ | ||
"if": { | ||
"not": { | ||
"required": [ | ||
"schemaFormat" | ||
] | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"schema": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"required": [ | ||
"schemaFormat" | ||
], | ||
"properties": { | ||
"schemaFormat": { | ||
"enum": [ | ||
"application/vnd.aai.asyncapi;version=2.0.0", | ||
"application/vnd.aai.asyncapi+json;version=2.0.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.0.0", | ||
"application/vnd.aai.asyncapi;version=2.1.0", | ||
"application/vnd.aai.asyncapi+json;version=2.1.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.1.0", | ||
"application/vnd.aai.asyncapi;version=2.2.0", | ||
"application/vnd.aai.asyncapi+json;version=2.2.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.2.0", | ||
"application/vnd.aai.asyncapi;version=2.3.0", | ||
"application/vnd.aai.asyncapi+json;version=2.3.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.3.0", | ||
"application/vnd.aai.asyncapi;version=2.4.0", | ||
"application/vnd.aai.asyncapi+json;version=2.4.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.4.0", | ||
"application/vnd.aai.asyncapi;version=2.5.0", | ||
"application/vnd.aai.asyncapi+json;version=2.5.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.5.0", | ||
"application/vnd.aai.asyncapi;version=2.6.0", | ||
"application/vnd.aai.asyncapi+json;version=2.6.0", | ||
"application/vnd.aai.asyncapi+yaml;version=2.6.0", | ||
"application/vnd.aai.asyncapi;version=3.0.0", | ||
"application/vnd.aai.asyncapi+json;version=3.0.0", | ||
"application/vnd.aai.asyncapi+yaml;version=3.0.0" | ||
] | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"schema": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"required": [ | ||
"schemaFormat" | ||
], | ||
"properties": { | ||
"schemaFormat": { | ||
"enum": [ | ||
"application/schema+json;version=draft-07", | ||
"application/schema+yaml;version=draft-07" | ||
] | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"schema": { | ||
"$ref": "http://json-schema.org/draft-07/schema" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"required": [ | ||
"schemaFormat" | ||
], | ||
"properties": { | ||
"schemaFormat": { | ||
"enum": [ | ||
"application/vnd.oai.openapi;version=3.0.0", | ||
"application/vnd.oai.openapi+json;version=3.0.0", | ||
"application/vnd.oai.openapi+yaml;version=3.0.0" | ||
] | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"schema": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"required": [ | ||
"schemaFormat" | ||
], | ||
"properties": { | ||
"schemaFormat": { | ||
"enum": [ | ||
"application/vnd.apache.avro;version=1.9.0", | ||
"application/vnd.apache.avro+json;version=1.9.0", | ||
"application/vnd.apache.avro+yaml;version=1.9.0" | ||
] | ||
} | ||
} | ||
}, | ||
"then": { | ||
"properties": { | ||
"schema": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/messagePayloadObject.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would call it something similar to |
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a union of the schema+format, just schema, or reference.