HN user

spacether

18 karma
Posts0
Comments7
View on HN
No posts found.
[GET] "/api/user/spacether/stories?hitsPerPage=30&page=0": 500 Failed to fetch user stories
[dead] 3 years ago

Version 3.3.0 released, allowing easy to use openapi v3.1.0 code generation. Use apis in python with full typing on inputs and outputs. >66% of the new json schema keywords have been implemented including: - const: only string values are working because of bugs in swagger parser - contains - dependentRequired - dependentSchemas - else - if - maxContains - minContains - patternProperties - prefixItems - propertyNames - then - type (array of types supported in addition to one non-array value) - unevaluatedItems - unevaluatedProperties

If you need a python client code generator for your openapi document please check out the project. It has type hints everywhere, passes mypy checks, and supports composition and multiple content types.

For developers out there who use openapi to auto-generate documentation and client libraries. If you need to do this in python, please consider using the new https://github.com/OpenAPITools/openapi-generator/blob/maste... generator, which I wrote.

Some reasons to use it:

  - it preserves spec case in model properties and endpoints
  - it enforces run time type checking
  - it has more robust composition (oneOf/anyOf/allOf) than the python generator
  - it has type hints
  - api loading is quicker (one can load one endpoint vs all of them automatically loading previously)
  - one can check if an instance validated against a schema by checking if the instance is an instance of the schema class
  - it uses python >= 3.9
  - it includes type: string format: number Decimal support so now you can send numbers as strings and preserve precision
  - enums are now accessible as class constants
  - uniqueItems validations added
  - multiple content types supported in endpoint request bodies + responses