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

Support for v3 #91

Open
nknapp opened this issue Mar 12, 2017 · 7 comments
Open

Support for v3 #91

nknapp opened this issue Mar 12, 2017 · 7 comments

Comments

@nknapp
Copy link
Member

nknapp commented Mar 12, 2017

I would be great to get pull-request that add support for the OpenAPI-v3-spec.
I would suggest to create helpers openapi-v2 and openapi-v3 so that the differing places can be handled smoothly:

{{#if (openapi-v2)}}
{{>swagger/definitions definitions=definitions}}
{{else if (openapi-v3)}}
{{>openapi/components components=components}}
{{/if}}

As an alternative, if there are converters, that support the fully-automatic conversion from openapi 2 to 3, we could also just use those as preprocessor.
@MikeRalphson
Copy link

If you do take a look at the preprocessor route, there is swagger2openapi https://github.com/mermade/swagger2openapi

@nknapp
Copy link
Member Author

nknapp commented Aug 7, 2017

This is the other way around, isn't it? I'd need a v3 to v2 converter...

But I'm actually at it already. bootprint-json-schema@next fully supports JSON-schema draft-05 which is the basis for v3. And I hope, that the next version of bootprint-openapi supports v2 and v3.

I'm going to work on it soon in the next-branch, but I don't know how long it will take. I hope to be able to set a basic structure soon. After that, all PRs will be very welcome.

@pdesjardins
Copy link

Has there been any progress toward supporting OpenApi 3.0.0 YAML? Thanks for this excellent project!

@nknapp
Copy link
Member Author

nknapp commented May 31, 2018

I'm sorry, but I have other priorities at the moment.

@pdesjardins
Copy link

Understood about priorities! We're lucky to have the work you were able to contribute.

I just forked so I can play around with the code myself. Do you know of an easy way to test local changes?

For example, would it be more practical to learn how to invoke Handlebars templates locally (http://handlebarsjs.com/installation.html)? Or can I build a local release of this project?

Any pointers will be much appreciated!

Peter

@nknapp
Copy link
Member Author

nknapp commented May 31, 2018

Hi Peter,

if you are planning to help developing this project, I will gladly give you push access to the repositories.

I think, despite priorities, I will still be able to release new versions, if needed.

As for local development... There are multiple ways. If you want to try changes to the templates, you should probably checkout all three bootprint-modules bootprint-openapi, bootprint-json-schema and bootprint-base. And link them together using npm link. You can then install bootprint globally and use the dev-mode to re-render the openapi-spec on-the-fly, once a template or stylesheet has changed.

I have written down the steps on https://gist.github.com/nknapp/02420131c1693db581788db18d925784

On the other hand, there are the test-cases in the test-directory. Each test consists of a openapi-spec and a mocha-testcase that compiles it and then inspects the generated output using cheerio.
The generated html will appear in the test-output directory, within the project-root.

Handlebars itself does not have a mechanism to invoke templates from the command line. That was one of the reasons for writing bootprint in the first place.

If you'd rather change templates and partials, without contributing them, you can also create your own bootprint-module. Have a look here.
Put your replacement templates in your modules partial-directory. If they are named like the original ones, it will override them.

If you want to contribute, I will help you as good as I can. Its just that I'm hardly using this module anymore, and if I am going to develop code for other people, at least I don't want to do it on my own.

@pdesjardins
Copy link

pdesjardins commented Jun 13, 2018 via email

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

No branches or pull requests

3 participants