Git Product home page Git Product logo

openapi-python-client's People

Contributors

acgray avatar bowenwr avatar christhekeele avatar csymeonides-mf avatar dbanty avatar deepsource-autofix[bot] avatar dependabot-preview[bot] avatar dependabot[bot] avatar dongfangtianyu avatar emann avatar expobrain avatar fabaff avatar forest-benchling avatar fyhertz avatar harabat avatar johnthagen avatar jpoehnelt avatar jrversteegh avatar jtv8 avatar kgutwin avatar mtovt avatar mtovts avatar p1-ra avatar packyg avatar ramnes avatar renovate[bot] avatar robertschweizer avatar rtaycher avatar supermihi avatar tedo-benchling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openapi-python-client's Issues

Add individual template tests

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.

Refactor to better mirror OpenAPI terminology

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:

  1. "Schema" in this project refers only to something declared in the "schemas" section of the OpenAPI document. In reality, the things we call "Response" and "Property" are also schemas in OpenAPI.
  2. "Property" refers to some property within an including schema. Properties are themselves schemas, so should be named as such.
  3. "Responses", rather than containing a schema, currently duplicate some of the behavior of schemas. This should be fixed.

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.

Support `nullable` keyword

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!

Provide an Optional Generation Style Supporting Access to the HTTP Response

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.

Python 3.7 support

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.

Support enum Schemas

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.

Generated Models Don't Inherit Parent Properties

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:

Screen Shot 2020-07-30 at 3 52 49 PM

Upgrade to Typer 0.1.0

Will allow us to remove the click-completion dependency, add a β€”version command, and test better using the test client.

Support JSON Bodies

Need to process the requestBody piece of endpoints and support serializing to JSON

Support arbitrarily nested list properties

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).

Support allOf in response schemas

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 oneOf keywords are not yet supported

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!

Generate a client as part of the testing process and run checks on it

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).

Support YAML OpenAPI Specs in Addition to JSON

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.

Only generate endpoints / schemas for certain tags

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.

Support Query Parameters

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.

Generate async clients

Probably using httpx, the major change is that all the functions should be async def so they're awaitable.

pipx: no matching distribution found for openapi-python-client

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:

  1. Execute pipx install openapi-python-client or pip install openapi-python-client or pip3 install openapi-python-client
  2. See error

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:

  • OS: Ubuntu 18.04
  • Python Version: 3.6.9
  • openapi-python-client version [0.4.2]

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!

Add more docs

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.

Fallback to standard string handling for unknown "format" values

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.

Deserialize JSON Response Bodies

Return types of API functions should be declared and JSON responses should return the proper dataclass or list of dataclasses.

Generation fails when "required" is not present for a parameter

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:

  1. Create a file openapi-spec-test.json with the contents below
  2. Run openapi-python-client generate --path openapi-spec-test.json
  3. See error:
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):

  • OS: MacOS 10.15.2
  • Python Version: 3.8.0
  • openapi-python-client version: 0.4.2

Generate incomplete clients

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.

Support form bodies

Specifically 'application/x-www-form-urlencoded' content in requestBody in OpenAPI schema.

Add basic details about Poetry to READMEs

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.

Server Base Path Not Applied to Generated Endpoint URLs

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:

  1. Given a spec file with a relative url defined in servers
  2. Generate a client: openapi-python-client generate --path openapi.json
  3. Use the generated client to make a request:
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):

  • OS: macOS 10.15.2
  • Python Version: 3.8.0
  • openapi-python-client version: 0.4.2

Additional context
Add any other context about the problem here.

Support overriding names

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"

Hook up CircleCI

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.

Catch conflicting Enums earlier

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.

Support Auth

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.

Prevent mutable defaults

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.

Allow defining Enums ahead of time

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.

Optionally disable validation

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.

Switch to httpx from requests

The httpx sync client works much like requests. This means one package for both sync and async clients (when async is supported).

Support text/csv responses

Not sure what the best Python format is for this. Maybe an arbitrary Dict? Maybe just an instance of CSVReader? Or CSVDictReader?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.