openapi-generators / openapi-python-client Goto Github PK
View Code? Open in Web Editor NEWGenerate modern Python clients from OpenAPI
License: MIT License
Generate modern Python clients from OpenAPI
License: MIT License
0.4.0 will have a lot of template changes, some of which replaced Python methods that were previously unit tested. Templates are not unit tested and e2e tests don't cover every case. I think it's necessary to have tests for templates that are as small/precise as possible to make sure nothing gets broken.
Needs to explain the basics of how to use the generated library (stuff that's common to all projects).
Is your feature request related to a problem? Please describe.
Currently some of the terms / organization in this project don't line up very well with OpenAPI terminology.
Examples:
Describe the solution you'd like
The best course of action, I think, is to separate the parsing of the OpenAPI document from the reorganization of data for client generation. Currently this is done all in one pass, mixing the logic and verbiage of the parsing with the client generation.
It may be possible to find a library which already exists which will parse the document into strongly typed objects. If not, I'll write one. The terminology of the parsed document should mirror the OpenAPI specification as closely as possible.
This project will then reorganize that already-parsed data into something that makes sense for client generation. Hopefully in the process some of the schema-logic can be simplified to make more interesting response types possible.
Is your feature request related to a problem? Please describe.
I attempted to generate a client from one of my OpenAPI specs, and the nullable
keyword is not yet supported
Describe the solution you'd like
I think nullable: true
should make a object type Optional
, even if it is required π€
Additional context
No pressure, I'm just documenting gaps as I come across them. π
Thanks, and great project!
Is your feature request related to a problem? Please describe.
Automatically generating models is great for many of our simple cases. However, there are a few cases where we'd like access to the original HTTP response - particularly the headers - without having to augment with another library like requests
.
One example is when paginating results. We want to retrieve a list of models, but there's also a HTTP header like X-Result-Count
that tells us how many total results are available.
Describe the solution you'd like
It would be great to have a Response
wrapper object that would minimally preserve the HTTP headers and still return the deserialized models.
Sample might look like:
T = TypeVar("T")
class Response(Generic[T]):
def body() -> T:
pass
def headers() -> Dict[str, List[str]]:
pass
For compatibility reasons this could be an option like --wrap-responses
which is False
by default, but when True
would update all the method signatures to use something like Response[Model]
or Response[List[Model]]
, etc.
Coming from the Java world, I've seen and used something like this in the past: https://square.github.io/retrofit/2.x/retrofit/retrofit2/Response.html
Describe alternatives you've considered
The current alternatives are either lose/ignore the functionality afforded from the headers or to manually make calls via another library (like requests
) and manually parse the response ourselves.
Is your feature request related to a problem? Please describe.
Python 3.8 is still too fresh and not supported by Anaconda.
Describe the solution you'd like
The library to be available on pip for Python 3.7.
Is your feature request related to a problem? Please describe.
Currently anything provided in a schema is assumed to be an object with properties. This means if an Enum is declared in schemas to be shared across endpoints (as is the case in the latest FastAPI/Pydantic), you get an empty dataclass as your enum instead of an actual Enum.
Describe the solution you'd like
Declaring an Enum in a schema should work exactly the same as declaring an Enum in-line for an endpoint. The output should be an Enum in the generated client.
Additional context
A simple way to see the problem is to regenerate the golden-master for end to end tests with the latest FastAPI/Pydantic.
Is your feature request related to a problem? Please describe.
Given OpenAPI YAML like (assume it's converted to JSON for generation):
components:
schemas:
Schema:
type: object
properties:
id:
type: string
name:
type: string
fieldDefinitions:
type: array
items:
$ref: '#/components/schemas/SchemaField'
type:
type: string
prefix:
type: string
registryId:
type: string
SchemaField:
type: object
properties:
isRequired:
type: boolean
name:
type: string
BoxSchema:
allOf:
- $ref: '#/components/schemas/Schema'
- type: object
properties:
height:
type: number
width:
type: number
containerSchema:
type: object
properties:
id:
type: string
name:
type: string
The Schema
class gets generated correctly like:
@dataclass
class Schema:
""" """
id: Optional[str] = None
name: Optional[str] = None
field_definitions: Optional[List[SchemaField]] = None
type: Optional[str] = None
prefix: Optional[str] = None
registry_id: Optional[str] = None
...
The BoxSchema
class is completely empty, with neither its own properties nor that of Schema
:
@dataclass
class BoxSchema:
""" """
def to_dict(self) -> Dict[str, Any]:
return {}
@staticmethod
def from_dict(d: Dict[str, Any]) -> BoxSchema:
return BoxSchema()
Describe the solution you'd like
Components that inherit from other components should generate a set of properties combining parent and individual properties. Other spec viewer projects appear to properly create the expected result:
Will allow us to remove the click-completion dependency, add a βversion command, and test better using the test client.
Need to process the requestBody piece of endpoints and support serializing to JSON
As per swagger's doc, operationId is an optional parameter:
operationId is an optional unique string used to identify an operation. If provided, these IDs must be unique among all operations described in your API.
Therefore, the following line should use a .get("operationId")
:
https://github.com/triaxtec/openapi-python-client/blob/7ef8b93931a33829de2e272f530ac379fc976670/openapi_python_client/openapi_parser/openapi.py#L146
Currently properties of type "array" can contain either a $ref, an enum, or a basic type (e.g. string, number).
The type should be recursive, so if there is an array property, it should support any type within it (including itself).
Is your feature request related to a problem? Please describe.
I attempted to generate a client from one of my OpenAPI specs, and allOf
and keywords are not yet supportedoneOf
Describe the solution you'd like
oneOf
should create a union type of the objects.
allOf
should create a type with all of the objects subfields.
Additional context
FYI, we've implemented allOf support in our fork here:
benchling/openapi-python-client@2670d11
benchling/openapi-python-client@9f5b95a (bugfix)
I will try to open a PR if I can find some free time π , otherwise feel free to pull in whatever you find useful!
This is a sort of e2e test to run after unit tests. We should have an openapi.json file we include for testing purposes which we can generate a client from. Then we can either have a "Golden Master" copy of that client we compare against or just run some checks against the generated client (e.g. mypy).
Should ignore at least .venv, egg-info, pycache
Is your feature request related to a problem? Please describe.
We maintain our OpenAPI spec in YAML, which is supported by many spec validators and other OpenAPI tooling. It would be great to able to generate the client directly from it instead of relying on conversion.
Describe the solution you'd like
Be able to directly import YAML like
openapi-python-client generate --path openapi.yaml
Describe alternatives you've considered
Currently during CI, we're exporting YAML to JSON like:
yq -j -P r openapi.yaml > openapi.json
However, this is potentially unsafe since YAML is a superset of JSON and supports some features.
It's possible that someone will want only certain pieces of an API for their usecase. Would be nice to be able to provide a list of tags in config to include and ignore all other tags. Maybe the opposite (a list to exclude) would be useful too.
If this is set, we should probably also prune any schemas (models) that were defined but never used.
Should include not only details of how to use the generator (this project) but the basics of how the generated library will look / work.
Process query params to Endpoints in generation and pass them through in the request. Functions should specify the type of those params but don't need to do additional validation yet.
Probably using httpx, the major change is that all the functions should be async def
so they're awaitable.
Describe the bug
When installing openapi-python-client through package manager an error is displayed saying there is no matching distribution.
To Reproduce
Steps to reproduce the behavior:
pipx install openapi-python-client
or pip install openapi-python-client
or pip3 install openapi-python-client
ERROR: Could not find a version that satisfies the requirement openapi-python-client (from versions: none)
ERROR: No matching distribution found for openapi-python-client
Desktop:
Additional context
Checked https://pypi.org/project/openapi-python-client/. Forced to installed pipx install openapi-python-client==0.4.2
, same error.
Thanks in advance!
README does its best to explain what you get in concise terms. It would probably be nicer to have a more expressive reference doc which walks through most of the things you could need to do with your generated client.
Is your feature request related to a problem? Please describe.
If a string field uses an arbirtrary custom "format" value, as allowed by the OpenAPI spec, it is rejected by the parser.
Describe the solution you'd like
As it is guaranteed to be a string, even if the exact format is unknown, I suggest that the parser should follow the recommended behaviour in the spec and fall back to handling the field as a plain string. This is the behaviour recommended by the specification:
Tools that do not support a specific format may default back to the type alone, as if the format is not specified.
Empty API responses are allowed by the OpenAPI spec but currently cause an error when parsing a schema which uses them:
Instead, they should be supported, probably returning None
as the response.
Return types of API functions should be declared and JSON responses should return the proper dataclass or list of dataclasses.
The following line wrongly requires a $ref
on every item:
https://github.com/triaxtec/openapi-python-client/blob/cba6fa2eeee96bb60161dde5c552887cbff573b6/openapi_python_client/openapi_parser/responses.py#L101
Describe the bug
When specifying a parameter without the required
key, an error occurs on generation.
Looking at the code, it seems to expect the required keyword will always be there for a parameter which according to the spec, it doesn't have to be: https://swagger.io/specification/#parameter-locations
To Reproduce
Steps to reproduce the behavior:
openapi-spec-test.json
with the contents belowopenapi-python-client generate --path openapi-spec-test.json
Traceback (most recent call last):
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/bin/openapi-python-client", line 10, in <module>
sys.exit(app())
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/typer/main.py", line 211, in __call__
return get_command(self)()
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/typer/main.py", line 494, in wrapper
return callback(**use_params) # type: ignore
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/openapi_python_client/cli.py", line 91, in generate
create_new_client(url=url, path=path)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/openapi_python_client/__init__.py", line 48, in create_new_client
project = _get_project_for_url_or_path(url=url, path=path)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/openapi_python_client/__init__.py", line 31, in _get_project_for_url_or_path
openapi = OpenAPI.from_dict(data_dict)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/openapi_python_client/openapi_parser/openapi.py", line 232, in from_dict
endpoint_collections_by_tag = EndpointCollection.from_dict(d["paths"])
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/openapi_python_client/openapi_parser/openapi.py", line 49, in from_dict
endpoint = Endpoint.from_data(data=method_data, path=path, method=method, tag=tag)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/openapi_python_client/openapi_parser/openapi.py", line 155, in from_data
endpoint._add_parameters(data)
File "/Users/wbowen/.pyenv/versions/3.8.0/envs/benchling-sdk/lib/python3.8/site-packages/openapi_python_client/openapi_parser/openapi.py", line 132, in _add_parameters
name=param_dict["name"], required=param_dict["required"], data=param_dict["schema"]
KeyError: 'required'
Expected behavior
The client generates successfully.
OpenAPI Spec File
{
"openapi": "3.0.1",
"info": {
"title": "Test API",
"version": "2.0.0",
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"externalDocs": {
"description": "Additional API Documentation",
"url": "https://test.com"
},
"servers": [{
"url": "/api/v2"
}],
"paths": {
"/requests/": {
"get": {
"tags": [
"requests"
],
"description": "List requests",
"operationId": "listRequests",
"parameters": [{
"name": "schemaId",
"in": "query",
"schema": {
"type": "string"
},
"required": true
},
{
"name": "pageSize",
"in": "query",
"schema": {
"type": "integer",
"default": 50,
"maximum": 100,
"minimum": 0
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Requests"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Request": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
}
}
}
}
Desktop (please complete the following information):
Currently if we can't parse the entire OpenAPI document, nothing is generated. Since there are still a lot of features left to add to cover the entirety of OpenAPI 3, it's probably better to still loudly tell the user the pieces we couldn't generate but give them as much as they can.
So if any piece of an endpoint can't be generated, that entire endpoint should be thrown out.
Specifically 'application/x-www-form-urlencoded' content in requestBody
in OpenAPI schema.
Heads-up: there's no link to this repo on the project's PyPI page
If it weren't for codecov, I wouldn't have been able to find it.
I believe this link can be added with the repository
attr of [tool.poetry]
Given that the generated projects will use Poetry and not everyone knows how to use it yet, it would be nice to add at least the basics needed to build / consume this project. Probably note the build and publish commands and link to the official docs for more info.
Describe the bug
When specifying a url
in servers
in a spec, the path is completely ignored in the generated endpoints. Making it necessary to fully qualify the base_url
passed to the Client
, which is problematic when supporting multiple API namespaces (e.g., /api/v2
, /api/experimental
).
To Reproduce
Steps to reproduce the behavior:
url
defined in servers
openapi-python-client generate --path openapi.json
from example_api.client import Client
from example_api.api.requests import get_request
client = Client(base_url="https://example.com/")
response = get_request(client=self.client, request_id="request_id")
The generated code in requests
shows:
url = "{}/requests/{request_id}".format(client.base_url, request_id=request_id)
The first part of the URL only puts in the server name passed to Client
, but ignores the specified server path from the spec. Resulting in an invalid URL like:
GET https://example.com/requests/request_id
Expected behavior
Should generate an HTTP request like:
GET https://example.com/api/v2/requests/request_id
The generated code would write the base path in like:
url = "{}/api/v2/requests/{request_id}".format(client.base_url, request_id=request_id)
OpenAPI Spec File
{
"openapi": "3.0.1",
"info": {
"title": "Example API",
"version": "2.0.0"
},
"servers": [{
"url": "/api/v2"
}],
"paths": {
"/requests/{request_id}": {
"get": {
"tags": [
"requests"
],
"description": "Get a request by ID",
"operationId": "getRequest",
"parameters": [{
"name": "request_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Request"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Request": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
}
}
}
}
This change might need to be behind a compatibility flag to avoid breaking existing code.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The auto-conversion to snake_case / PascalCase doesn't always work super great, specifically when a class has an acronym in it. We should allow users to provide some sort of config that allows naming overrides. E.g. "ABCModel" should be "abc_model.ABCModel" instead of "a_b_c_model.ABCModel"
In 0.4.0-rc.1, if a server responds with an Optional Enum and provides null (not missing) it causes an error in the client.
Need to update the CircleCI config to actually do something with this project, send build status back to GitHub, auto-publish to public PyPI. etc.
Right now, conflicting Enums are detected at the very end of parsing and if there are any the entire generation is aborted. It would be better to detect a potential conflict earlier and just rename the conflicting Enum to something else when it comes up.
Need a way to pass credentials into endpoints. Just whatever auth is required by our Inventory API for now (standard OAuth 2 flow), don't need to support other security schemes yet.
It is possible for a default value to be something like an empty dict which is not allowed by a dataclass. If possible, we should prevent that and instead use defaultfactory when creating fields like that.
Because Enum isn't a real schema type in OpenAPI, we currently create them by making up a name from the property that defined them. That means if you have the same Enum in multiple places with different property names, you'll get multiple enums. Member names are also made up from the values, so those are sometimes not very descriptive.
We should add a section to config.yml that lets users define Enums, then check any Enum we come across to see if its values match the values of a known Enum. If they do, use that Enum.
Is your feature request related to a problem? Please describe.
It seems that some OpenAPI specifications aren't always correct, but it might be helpful to allow generation anyway.
For example, I installed the latest version from the main
branch using:
poetry add git+https://github.com/triaxtec/openapi-python-client.git@main
pip install importlib_metadata
openapi-python-client generate --url https://api.biocontainers.pro/ga4gh/trs/v2/openapi.json
and the warnings I got were:
Traceback (most recent call last):
File "/media/michael/Storage2/Programming/BioBackhaul/venv/bin/openapi-python-client", line 33, in <module>
sys.exit(load_entry_point('openapi-python-client', 'console_scripts', 'openapi-python-client')())
File "/media/michael/Storage2/Programming/BioBackhaul/venv/lib/python3.7/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/media/michael/Storage2/Programming/BioBackhaul/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/lib/python3.7/site-packages/typer/main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "/media/michael/Storage2/Programming/BioBackhaul/venv/src/openapi-python-client/openapi_python_client/cli.py", line 91, in generate
create_new_client(url=url, path=path)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/src/openapi-python-client/openapi_python_client/__init__.py", line 48, in create_new_client
project = _get_project_for_url_or_path(url=url, path=path)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/src/openapi-python-client/openapi_python_client/__init__.py", line 31, in _get_project_for_url_or_path
openapi = GeneratorData.from_dict(data_dict)
File "/media/michael/Storage2/Programming/BioBackhaul/venv/src/openapi-python-client/openapi_python_client/openapi_parser/openapi.py", line 243, in from_dict
openapi = oai.OpenAPI.parse_obj(d)
File "pydantic/main.py", line 455, in pydantic.main.BaseModel.parse_obj
File "pydantic/main.py", line 346, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 93 validation errors for OpenAPI
paths -> /facets -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /facets -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /facets -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /facets -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /facets -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /facets -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /facets -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /facets -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /facets -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /service-info -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /stats -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /stats -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /stats -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /stats -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /stats -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /stats -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /stats -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /stats -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /stats -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /toolClasses -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /toolClasses -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /toolClasses -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /toolClasses -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /toolClasses -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /toolClasses -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /toolClasses -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /toolClasses -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /toolClasses -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /tools -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /tools -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> responses -> 200 -> headers
extra fields not permitted (type=value_error.extra)
paths -> /tools -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id} -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/similars -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/similars -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id} -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/containerfile -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/descriptor -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/descriptor/{relative_path} -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/files -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> content -> application/json -> schema -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> content -> application/json -> schema -> items
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> content -> application/json -> schema -> type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> content -> application/json -> schema -> x-content-type
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> $ref
field required (type=value_error.missing)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> content
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> responses -> 200 -> description
extra fields not permitted (type=value_error.extra)
paths -> /tools/{id}/versions/{version_id}/{type}/tests -> get -> x-openapi-router-controller
extra fields not permitted (type=value_error.extra)
components -> securitySchemes -> BEARER -> x-apikeyInfoFunc
extra fields not permitted (type=value_error.extra)
components -> securitySchemes -> BEARER -> $ref
field required (type=value_error.missing)
components -> securitySchemes -> BEARER -> in
extra fields not permitted (type=value_error.extra)
components -> securitySchemes -> BEARER -> name
extra fields not permitted (type=value_error.extra)
components -> securitySchemes -> BEARER -> type
extra fields not permitted (type=value_error.extra)
components -> securitySchemes -> BEARER -> x-apikeyInfoFunc
extra fields not permitted (type=value_error.extra)
Describe the solution you'd like
I would like a flag, for example --skip-validation
, that disables the validation if the errors aren't fatal. In the above case, they're simply extra fields, so it shouldn't prohibit running the generator.
Describe alternatives you've considered
I was able to use openapi-generator with the --skip-validate-spec
flag, which worked, but I would like to be able to do this in pure python.
The httpx sync client works much like requests. This means one package for both sync and async clients (when async is supported).
Not sure what the best Python format is for this. Maybe an arbitrary Dict? Maybe just an instance of CSVReader? Or CSVDictReader?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.