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
Fix: #182. Fix yaml support. Improve OAS3 #183
Conversation
@@ -633,10 +632,21 @@ def parse_raw_obj(self, name: str, raw: Dict[str, Any], path: List[str]) -> None | |||
self.parse_ref(obj, path) | |||
|
|||
def parse_raw(self) -> None: | |||
raw_obj: Dict[Any, Any] = json.loads(self.text) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always use yaml parser so we don't care about file format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor fixes and start splitting files out of the test file.
self.parse_raw_obj(key, model, [path, key]) | ||
|
||
|
||
def get_oas_schema(oas_spec: Dict[Any, Any]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for different OAS schemas:
OAS2 - #/definitions
OAS3- #/components/schemas
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot the difference.
This file is for JSON Schema
.
this method name should not have OSA
.
Would you please remove OSA
from the method ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed you had another class for OAS3, and I moved out stuff there.
Should be fixed now.
We'll find a way to fix the usage of definitions
in jsonschema another time :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code generator supported only OSA3 for the first time.
But, I supported JSON Schema by a request.
We will fix it next time:wink:
d151c9d
to
ddebf86
Compare
Codecov Report
@@ Coverage Diff @@
## master #183 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 11 11
Lines 946 947 +1
Branches 189 189
=========================================
+ Hits 946 947 +1
Continue to review full report at Codecov.
|
@ioggstream |
ddebf86
to
3dd9e99
Compare
3dd9e99
to
8b2e529
Compare
Should be ok. Take some time to review in the next days. :D |
I think this PR is fine. I have merged this PR because I prefer a short iteration in this phase. |
@ioggstream Thank you very much. |
This PR
Fix yaml support
Improves OAS3
Use snaphots for tests