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

Proposal of OpenAPI 3 #133

Open
fmigneault opened this issue Apr 29, 2020 · 5 comments
Open

Proposal of OpenAPI 3 #133

fmigneault opened this issue Apr 29, 2020 · 5 comments

Comments

@fmigneault
Copy link

fmigneault commented Apr 29, 2020

Hi!

I've been working on OpenAPI-3 support (#69) building on top of the code of this repo. I've got it working now. My code is not completely cleaned up and I can't have possibly tested all API use cases, but I would be happy make it into a proper PR if the maintainers are also willing to support it here.

The changes for the current code are as follows:
master...fmigneault:oneOf-objects

Plus the following objects I added in my repo to override/expand the existing converters:
https://github.com/crim-ca/weaver/blob/job-io-extras/weaver/wps_restapi/colander_extras.py

I'm using the following spec (quite big):
https://github.com/crim-ca/weaver/blob/job-io-extras/weaver/wps_restapi/swagger_definitions.py

I'm getting the results/features like follows :

  • keywords like oneOf, allOf, anyOf supported (with deserialize() validation) (oneOf, allOf, anyOf, not - keyword for objects and arrays #95)
  • support specifying format or pattern of string type (and adds the appropriate validator for free)
  • each view with different accept or content_type or renderer can make a separate item under the responses.content or requestBody.content as required by the spec.

image

other things:

  • fix the description not carried over (Path parameters don't preserve description #94)
  • support default auto-replaced when using schema deserialization and other nice-to-have schema definitions
  • support of writing the title when the auto-one is not so great
  • backward support of Swagger 2.0 using an input to generate and/or directly set in CorniceSwagger class.

image

Let me know of your thoughts and if we could improve it even more.

@fmigneault
Copy link
Author

@leplatrem @gabisurita

@leplatrem
Copy link
Contributor

Hello @fmigneault !

Thanks for your submission :) Looks like a solid start!

I must admit that my review queue is pretty big and this project has pretty low priority unfortunately :(
Since it seems to have made pretty good progress already, I believe you could open a PR so that we can make our first feedback.

In case it takes too long for us to give you reviews, I wouldn't be against giving write permissions to this repo to make it more agile.

@gabisurita how are things on your side?

@fmigneault
Copy link
Author

That's fine. It will take me some time to make a clean PR. I want to add more tests also because it's quite a big amount of new features.

@Manuelraa
Copy link

Heyo how is stuff going?

@fmigneault
Copy link
Author

@Manuelraa
I've got working OpenAPI generation, example here:
blob:https://pavics-weaver.readthedocs.io/9b90ba9e-5491-48b7-bbc8-1fbb52c7ca46

But this is still thightly coupled to the extended classes located here:
https://github.com/crim-ca/weaver/blob/job-io-extras/weaver/wps_restapi/colander_extras.py

I still have yet to find some time to extract it an make a clean PR here.

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