Skip to content
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

Make Schema a superset of JSON Schema Draft 07 #256

Merged
merged 3 commits into from
Aug 13, 2019

Conversation

fmvilas
Copy link
Member

@fmvilas fmvilas commented Aug 8, 2019

Fixes #212

@philsturgeon would you mind having a look at this PR? I took yours and changed/added some stuff.

Clarifications:

  • XML Object and xml property have been removed. Future versions of AsyncAPI will support XSD, which is better suited for XML definitions.
  • We're not moving to Draft-08 yet because of the lack of tooling and, IIRC, Draft-08 is still not released. However, we're doing steps in this direction by adding deprecated to our superset. Once Draft-08 is out and tooling implemented it, we can get rid of this property.
  • We still support OpenAPI schemas on message payloads. Just indicate schemaFormat is application/vnd.oai.openapi;version=3.0.0. Actually, once OpenAPI gets rid of their current Schema object and evolves into a Draft-08 superset, we will be able to align again.

@WaleedAshraf
Copy link
Contributor

@fmvilas
Copy link
Member Author

fmvilas commented Aug 12, 2019

Oh yeah! The payload can be serialized to anything. We're just removing a feature (originally from OpenAPI schemas) that allows you to define XML using JSON Schema-like syntax. I'm doing this on purpose to keep it simple. If people request this feature in the future we can consider adding it. Adding is easy and quick but removing it later would be a mess and would require a major version bump.

It's on the roadmap for the next minor version to add support for non-JSON schema languages: XSD, Protobuf, etc. XSD is what most people using XML use for schema contracts.

@fmvilas
Copy link
Member Author

fmvilas commented Aug 12, 2019

Also, people can still use OpenAPI schemas if they need it. What's being changed here is the default schema format.

@fmvilas fmvilas force-pushed the feature/default-to-draft-07 branch from 896a21f to 1e80c7c Compare August 13, 2019 13:36
@fmvilas fmvilas merged commit 1fcfb71 into master Aug 13, 2019
@fmvilas fmvilas deleted the feature/default-to-draft-07 branch August 13, 2019 13:42
@fmvilas
Copy link
Member Author

fmvilas commented Aug 13, 2019

I'm moving forward and gonna merge this PR. Please, if you see something wrong, missing, or just don't agree with the changes, don't hesitate to leave a comment after it's merged. I'll be happy to address these questions afterward.

@fmvilas
Copy link
Member Author

fmvilas commented Aug 13, 2019

Thanks, @philsturgeon, and @WaleedAshraf for reviewing it.

@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[2.0.0 REVIEW] Use JSON Schema Draft 07 as the default schema
4 participants