Skip to content

feat: add OpenAPI registration module - #45

Merged
uniqueg merged 9 commits into
devfrom
40-add-openapi-registration
Jun 15, 2020
Merged

uniqueg merged 9 commits into
devfrom
40-add-openapi-registration

Conversation

@stikos

@stikos stikos commented Jun 3, 2020 •

Copy link
Copy Markdown
Contributor

Description

Creation of a module for OpenAPI endpoints registration with the option of multiple configuration files usage

Fixes #40

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have not reduced the existing code coverage

stikos added 4 commits June 1, 2020 12:24
Addition of an OpenAPI registration module

(#40)
Removed a redundant specs dictionary object declaration

(#40)
@stikos stikos changed the title 40 add openapi registration 40-add-openapi-registration Jun 3, 2020
@stikos
stikos marked this pull request as draft June 3, 2020 18:13

@uniqueg uniqueg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks quite good - thanks a lot! Please add the suggested changes and then start implementing the tests. :-)

Comment thread foca/errors/errors.py Resolved
Comment thread foca/errors/errors.py Resolved
Comment thread foca/api/register_openapi.py Resolved
Comment thread foca/api/register_openapi.py Resolved
Comment thread foca/errors/errors.py Resolved
Comment thread foca/api/register_openapi.py Resolved
Comment thread foca/api/register_openapi.py Resolved
@uniqueg

uniqueg commented Jun 11, 2020

Copy link
Copy Markdown
Member

Oh, and please take care of the flake8 linting issues; there aren't too many

@stikos stikos self-assigned this Jun 12, 2020
Rustructured InvalidSpecification error, extended OpenAPIConfig class documaentation, flake8 linting consistency, other minor fixes

(#40)
@stikos

stikos commented Jun 13, 2020

Copy link
Copy Markdown
Contributor Author

I've incorporated the sugggested changes, let me know if they meet the requirements.
Regarding the testing modules developement, I think I'll need some guidance 😃

@uniqueg uniqueg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one suggestion to add validation code for the OpenAPIConfig class constructor. The rest are just hints how you can write tests for the code.

Comment thread foca/api/register_openapi.py Resolved
Comment thread foca/api/register_openapi.py Resolved
Comment thread foca/api/register_openapi.py Resolved
Comment thread foca/api/register_openapi.py Resolved
@stikos

stikos commented Jun 13, 2020 •

Copy link
Copy Markdown
Contributor Author

@uniqueg For the validation code, should I just check the consistency of the types of the inputs with those of the class attributes? Since the validity of their format is checked in register_openapi(). And what about the out_file attribute? Should the validity of a possibly provided path be verified?

@uniqueg

uniqueg commented Jun 14, 2020

Copy link
Copy Markdown
Member

@stikos I have been working a lot on this (there was a lot to consider still, especially with using pydantic) and I think I'm now pretty happy with it. I have started writing tests, too - if that goes reasonably fast, I'll push and merge tonight. If not, I'll push what I have and you can take it from there. Let's try to merge this latest tomorrow because it's kinda blocking other issues.

@uniqueg uniqueg changed the title 40-add-openapi-registration feat: add OpenAPI registration module Jun 15, 2020
@uniqueg
uniqueg marked this pull request as ready for review June 15, 2020 03:01
@uniqueg
uniqueg merged commit 47a1e38 into dev Jun 15, 2020
@uniqueg
uniqueg deleted the 40-add-openapi-registration branch June 15, 2020 03:20
uniqueg added a commit that referenced this pull request Jul 3, 2020
Allow registering one or more OpenAPI 2.x and 3.x YAML specification files with a Connexion app. Some options are available to easily modify specifications, specifically for adding security definitions and the `x-swagger-router-controller` field. Additional config options can be passed through to Connexion.

Co-authored-by: Alex Kanitz <[email protected]>
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 this pull request may close these issues.

Add OpenAPI registration module

2 participants