Skip to content

Make Schema a superset of JSON Schema Draft 07#256

Merged
fmvilas merged 3 commits into
masterfrom
feature/default-to-draft-07
Aug 13, 2019
Merged

Make Schema a superset of JSON Schema Draft 07#256
fmvilas merged 3 commits into
masterfrom
feature/default-to-draft-07

Conversation

@fmvilas

@fmvilas fmvilas commented Aug 8, 2019

Copy link
Copy Markdown
Contributor

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.

Comment thread versions/next/asyncapi.md Outdated
@WaleedAshraf

Copy link
Copy Markdown
Contributor

@fmvilas

fmvilas commented Aug 12, 2019

Copy link
Copy Markdown
Contributor Author

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

fmvilas commented Aug 12, 2019

Copy link
Copy Markdown
Contributor Author

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

fmvilas commented Aug 13, 2019

Copy link
Copy Markdown
Contributor Author

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

fmvilas commented Aug 13, 2019

Copy link
Copy Markdown
Contributor Author

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

@asyncapi-bot

Copy link
Copy Markdown
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