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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/data/expected/parser/openapi/openapi_parser_parse_remote_ref/with_import_format.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Optional | ||
|
||
from pydantic import AnyUrl, BaseModel, conint | ||
|
||
|
||
class Problem(BaseModel): | ||
detail: Optional[str] = None | ||
instance: Optional[AnyUrl] = None | ||
status: Optional[conint(ge=100, le=600, lt=1)] = None | ||
title: Optional[str] = None | ||
type: Optional[AnyUrl] = 'about:blank' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class BoundingBox(BaseModel): | ||
type: str | ||
coordinates: List[Union[float, str]] | ||
|
||
|
||
class Model(BaseModel): | ||
bounding_box: Optional[BoundingBox] = None | ||
attributes: Optional[Dict[str, Any]] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"properties": { | ||
"item": { | ||
"properties": { | ||
"timeout": { | ||
"oneOf": [ | ||
{ | ||
"type": "string" | ||
}, | ||
{ | ||
"type": "integer" | ||
} | ||
] | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class Item(BaseModel): | ||
timeout: Optional[Union[str, int]] = None | ||
|
||
|
||
class OnOfObject(BaseModel): | ||
item: Optional[Item] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
schemas: | ||
Problem: | ||
properties: | ||
detail: | ||
description: | | ||
A human readable explanation specific to this occurrence of the | ||
problem. You MUST NOT expose internal informations, personal | ||
data or implementation details through this field. | ||
example: Request took too long to complete. | ||
type: string | ||
instance: | ||
description: | | ||
An absolute URI that identifies the specific occurrence of the problem. | ||
It may or may not yield further information if dereferenced. | ||
format: uri | ||
type: string | ||
status: | ||
description: | | ||
The HTTP status code generated by the origin server for this occurrence | ||
of the problem. | ||
example: 503 | ||
exclusiveMaximum: true | ||
format: int32 | ||
maximum: 600 | ||
minimum: 100 | ||
type: integer | ||
title: | ||
description: | | ||
A short, summary of the problem type. Written in english and readable | ||
for engineers (usually not suited for non technical stakeholders and | ||
not localized); example: Service Unavailable | ||
type: string | ||
type: | ||
default: about:blank | ||
description: | | ||
An absolute URI that identifies the problem type. When dereferenced, | ||
it SHOULD provide human-readable documentation for the problem type | ||
(e.g., using HTML). | ||
example: https://tools.ietf.org/html/rfc7231#section-6.6.4 | ||
format: uri | ||
type: string | ||
type: object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
openapi: 3.0.1 | ||
components: | ||
schemas: | ||
Problem: | ||
$ref: "https://teamdigitale.github.io/openapi/0.0.6/definitions.yaml#/schemas/Problem" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 👍