krakenjs / hapi-openapi

Build design-driven apis with OpenAPI (formerly swagger) 2.0 and hapi.
Other
211 stars 75 forks source link

Add support for OpenAPI 3 #181

Open tpburch opened 4 years ago

tpburch commented 4 years ago

Addresses https://github.com/krakenjs/hapi-openapi/issues/146

When completed, this PR will add support for OpenAPI 3. This necessarily a very invasive change to the codebase. Due to this, I wanted to get a draft of the partial changes out for initial feedback on the approach I am taking.

The major changes in this initial draft are:

Next steps:

As this is a draft PR - I am very interested in any comments, concerns, gotchas, etc.

tlivings commented 4 years ago

There are now 2 PRs for this (#183 and this one).

Can we make sure we converge on one?

tpburch commented 4 years ago

@tlivings @sprootshift Agreed - we should probably determine an overall direction. This PR is definitely a bigger overall design change, which may not be the direction you want to go on this. My goal is to centralize the logic differences needed to handle different schema versions.

I think the approach in https://github.com/krakenjs/hapi-openapi/pull/183 is equally valid. It will likely result in fewer overall changes, but the specifics of both OAS2 and OAS3 schemas will be more spread out throughout the library.

It looks like https://github.com/krakenjs/hapi-openapi/pull/183 is handling the schema version differences in regards to the interaction with enjoi. There are a few other areas where OAS2 & OAS3 differ that need to be handled, assuming the goal is feature parity for schema versions.

Which way would you like to go with this?

tlivings commented 4 years ago

Can @tpburch and @sprootshift come to an alignment on the change?

Thanks.

sprootshift commented 4 years ago

I think these are somewhat independent PRs. I agree with @tpburch re "https://github.com/krakenjs/hapi-openapi/pull/183 likely result in fewer overall changes, but the specifics of both OAS2 and OAS3 schemas will be more spread out throughout the library". I consider https://github.com/krakenjs/hapi-openapi/pull/183 a feature expansion and https://github.com/krakenjs/hapi-openapi/pull/181 a refactoring to isolate OpenAPI 2 and 3 schema differences and hide behind a common interface. Although some isolation is already provided by swagger-parser.

tpburch commented 4 years ago

With the recent announcement that Hapi will be sunset, my use case for these changes has basically evaporated. Based on that, it probably makes sense to go ahead with https://github.com/krakenjs/hapi-openapi/pull/183 for the overall functionality.

@sprootshift - Having said that, feel free to use any or all of the changes in this PR if you feel like it will help and/or add additional functionality.

tlivings commented 4 years ago

Hapi will continue to be supported for 2 years minimum and is unlikely to be going away in the near term.

mahnunchik commented 3 years ago

Is this project dead?

tlivings commented 3 years ago

No, but I’m the only maintainer left from the team and don’t have a lot of time to focus on it these days.

I appreciate and try to keep up with PRs as they come but ideally a couple of additional maintainers can start helping out.

dcharbonnier commented 3 years ago

I guess we can close this ont @tlivings