Skip to content

feat: add #/components/schemas parsing to retrieve explicit schema#29

Merged
manchenkoff merged 2 commits intomanchenkoff:masterfrom
johmau:add_components_schemas_parsing
Jun 23, 2022
Merged

feat: add #/components/schemas parsing to retrieve explicit schema#29
manchenkoff merged 2 commits intomanchenkoff:masterfrom
johmau:add_components_schemas_parsing

Conversation

@johmau
Copy link
Copy Markdown
Contributor

@johmau johmau commented Jun 21, 2022

As "securitySchema", parsing "schemas" would be great.
I'm using it for own code generation plugin.
It would be cool if you put it in the mainline.

Thx

@manchenkoff manchenkoff self-requested a review June 21, 2022 13:10
@manchenkoff manchenkoff added the enhancement New feature or request label Jun 21, 2022
@manchenkoff
Copy link
Copy Markdown
Owner

Hey @johmau, thanks for contributing! I also use this package for code-generation stuff, so I have a question regarding your changes. Since you have schemas in the components section you probably use them in some endpoints' schemas. Could you describe the case when you need schemas from components instead of paths?

@johmau
Copy link
Copy Markdown
Contributor Author

johmau commented Jun 21, 2022

Hi @manchenkoff !

I use those schemas to generate specific input classes for my cpp web framework, with that I can create a class named Uuid for example and differenciate the name from the property in the endpoint itself. If I use the property I'm forced to use a class name based on the property name, then If I've several Uuid in my endpoint, I will have several class declaration althought there the same structure and I won't be able to automatically extends them afterward. I've the structure I can generate all my input classes easily. It's really specific but it's also not that weird to have those schemas in the specification class.

Thx

@manchenkoff
Copy link
Copy Markdown
Owner

Agree, for now this is fine solution, but I had another idea - to parse it with names for endpoints as well, but I need to make some changes in the external package first. So, I left some comments and I'll be ready to merge once you fixed it 👍

@johmau
Copy link
Copy Markdown
Contributor Author

johmau commented Jun 21, 2022

@manchenkoff Ok great !

@johmau johmau force-pushed the add_components_schemas_parsing branch from f49e3a5 to 820f61f Compare June 21, 2022 22:42
@johmau johmau requested a review from manchenkoff June 21, 2022 22:43
@manchenkoff
Copy link
Copy Markdown
Owner

manchenkoff commented Jun 22, 2022

Hey @johmau, please, check CI report, there is some broken unit test. I assume that is because of the new parameter in the constructor method.

@johmau
Copy link
Copy Markdown
Contributor Author

johmau commented Jun 22, 2022

@manchenkoff Forgot unit test Fuuu let's fix that

Signed-off-by: johmau <johmau@obspher.com>
@johmau johmau requested a review from manchenkoff June 22, 2022 22:53
@manchenkoff manchenkoff merged commit 26b0bf9 into manchenkoff:master Jun 23, 2022
@manchenkoff
Copy link
Copy Markdown
Owner

manchenkoff commented Jun 23, 2022

@johmau, 1.1.2 version has been published to PyPi, thanks 👍

@johmau johmau deleted the add_components_schemas_parsing branch June 23, 2022 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants