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

Upgrading to support examples from draft-06 #20

Open
Solosneros opened this issue Jan 31, 2019 · 11 comments · May be fixed by #22
Open

Upgrading to support examples from draft-06 #20

Solosneros opened this issue Jan 31, 2019 · 11 comments · May be fixed by #22

Comments

@Solosneros
Copy link

We want to convert JSON Schema to OAI 3.0.
Your package seems to be the perfect solution for us.
Everything works perfectly with the exception of examples which have been added in Draft-06.
Is there any possibility to add the feature to convert examples of JSON Schema to example of OAI 3.0? E.g. only converting the first example?

"currency": { "type": [ "string", "null" ], "default": "EUR", "minLength": 3, "maxLength": 3, "title": "Currency", "description": "Currency code", "examples": [ "EUR", "GBP", "USD" ] },

If you have any other suggestions to address this problem, we would look forward to hear about them.

@philsturgeon
Copy link
Contributor

I’m not sure what we’d do here. There’s the OpenAPI 3.0 example keyword (notice it’s singular), so we could take the first only?

Other than that you’d have to make full response body examples and they live outside of the Schema object.

@sixlive
Copy link

sixlive commented Feb 9, 2019

I think it could be useful to just grab the first one. If you wanted more variety you could manually add full example objects.

edit: I've worked up a possible implementation master...sixlive:add-draft-6-examples

edit 2: I used my fork with this branch with speccy and it resolved as expected with the first example.

@Solosneros
Copy link
Author

@philsturgeon The first thing you mentioned is what I thought of.

@sixlive Thanks! From what understand from the code, that looks like something I would implement as well. I just lacked the the overview in the whole project and where to implement. :)

@sixlive
Copy link

sixlive commented Feb 11, 2019

After writing a bunch of schemas and working on documentation today, this is a must-have feature for me. If there is anything I can/need to do to get this moving let me know. I can open a PR ASAP.

@sixlive sixlive linked a pull request Feb 15, 2019 that will close this issue
@Solosneros
Copy link
Author

Hey, still looking forward to this. I assume one would just have to merge the PR. @philsturgeon @sixlive

@philsturgeon
Copy link
Contributor

Hey I am no longer working for WeWork so i don't have the permissions to merge this. @sixlive never worked there. :)

@djtarazona hey dude, could you merge this and cut a release?

@philsturgeon
Copy link
Contributor

@djtarazona sorry I mean merge this: #22

@mribichich
Copy link

do we have news about this? does this project still active?

@Solosneros
Copy link
Author

@mribichich Just came across this issue again. It seams like the project is inactive. @djtarazona or @philsturgeon ?

@philsturgeon
Copy link
Contributor

philsturgeon commented Jan 20, 2020

It seems pretty clear from this thread that WeWork is not maintaining this package. I hope my friends over there are ok, but with 1000 of the eng team being fired not so long ago I have my doubts that packages like this will be on anyones radar anymore. I've forked the repo to the OpenAPI-Contrib organization, so if anyone wants this PR it's included in v1.0.0.

npm install @openapi-contrib/json-schema-to-openapi-schema

See you over there folks: https://www.npmjs.com/package/@openapi-contrib/json-schema-to-openapi-schema

@Solosneros
Copy link
Author

Sad to hear.
Thanks for the fork!

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

Successfully merging a pull request may close this issue.

4 participants