Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74e9139
commit 3dd9e99
Showing
11 changed files
with
124 additions
and
40 deletions.
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