Comments (9)
Could these help?
- https://github.com/wework/json-schema-to-openapi-schema
- https://github.com/mikunn/openapi-schema-to-json-schema
I'd love a solution to this issue too!
Also, since AsyncAPI isn't OpenAPI why not just use a subset of JSON Schema Draft XY? OpenAPI schemas are not exactly a subset + history has shown people get confused between the two + there are way more JSON Schema validators/tools than there are for OpenAPI Schemas...
I can't wait for both these standards to support "here's my schema in language XYZ" :)
from generator.
We removed support for multiple formats on a single message for simplicity of the spec because that's not the case of many people. Overlays will allow you to do that. In any case, if the message is not exactly the same, they should be different messages.
from generator.
This was fixed by #204. Closing.
from generator.
Maybe the JSON schema version of "nullable": true
works?
"type": ["null", ...]
from generator.
The editor does not complain with type: ["null", string]
But it shouldn't work as per the specification:
The following properties are taken from the JSON Schema definition but their definitions were adjusted to the AsyncAPI Specification.
type - Value MUST be a string. Multiple types via an array are not supported.
from generator.
Hi @ymarillet! Sorry for the late response. I'm currently on holidays and can't help so much but there are two issues here:
- As you correctly point out, it should be supporting nullable and should be complaining about [null, string].
- The reason you don't see it working is because the documentation generator is parsing the schemas as if they were jsonschema schemas instead of asyncapi schemas. And on top of that, I didn't take into account the possibility of having a nullable property.
Would you mind creating a PR on https://github.com/asyncapi/docgen?
from generator.
Hello there
I don't have much time to work on this unfortunately :(, but will try to as soon as I get some spare time..
In the meantime, please do not consider I'm working on it activly.
I really like the project though, hope it'll get even better !
from generator.
@fenollp I'm glad you ask for multiple schema support. It's already implemented in the spec for version 2.0.0, which should be ready by May this year. Check it out:
from generator.
@fmvilas Nice! May isn’t far off too :)
We’re going to need to be able to specify schemas in more than one formats though at some point. It appears you’d prefer to allow as of yet unspec-ed Overlays instead of allowing multiple schema formats for the same payload. Why not. I guess there are issues I’m not seeing with the latter.
Anyway we may rely on something that translates for example our protobuf to JSON schema but these two have semantics that the other misses so I’m not sure about that yet.
from generator.
Related Issues (20)
- File Location $ref Inconsistent Between `validate` and `generate` Commands HOT 3
- Generator with parameter sidebarOrganization=byTags throws error: Found non-callable @@iterator HOT 8
- Custom examples not working when file is generated HOT 4
- Blank page when generating html doc HOT 6
- Installing 'source-map-support' package results in wrong call stack HOT 1
- AsyncAPi to MD - TypeError: message.messageId is not a function HOT 2
- Shared avro model results in incorrect AsyncAPI document HOT 4
- Path contains invalid characters HOT 3
- Bug: Need to perform the testing in the exlusive env. HOT 1
- Bug: Need to perform exclusive testing in generator HOT 1
- Improve arborist (npm installation) to have no hacks HOT 4
- Allow $$operation$$ file template HOT 2
- `noOverwriteGlobs` will not work in majority of cases in templates using react HOT 10
- Proposal for mentorship of potential maintainers of generator -> `Becoming a Maintainer of AsyncAPI Generator` HOT 22
- [BUG] Demo from homepage does not work HOT 7
- Need to add proper options to generate the template from private registory using CLI
- Allowing Generator to pull the templates from the private GitHub Repository
- [Docs Bug 🐞 report]: The `template-constant` link is broken at the generator docs HOT 6
- [Docs Bug 🐞 report]: The `AsyncAPI document` button is broken at the generator docs HOT 2
- [📑 Docs]: Improve documentation related to `File templates` feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator.