Skip to content

OpenAPI

OpenAPI compatibility

  • βœ… openapi: validated (3.0.* accepted)
  • info
    • ❌ license: N/A; it's up to the user to verify the accepted use.
    • πŸ—“οΈ title and other fields: planned as part of project readme
  • πŸ—“οΈ externalDocs: planned as part of the project readme
  • βœ… servers: first server is used
    • βœ… url: used as the base URL
    • βœ… variables: default values are used to evaluate the server URL
  • βœ… security: implemented
  • ❌ tags: ignored
  • components
    • βœ… schemas:
      • πŸ—“οΈ title: planned as part of class docstr
      • type
        • βœ… [no value]: implemented as pydantic.JsonValue
        • ⚠️ caveat: it which includes None
        • βœ… object: implemented as pydantic model
        • βœ… array: implemented as list
        • βœ… string, integer, number, boolean: implemented as str, int, float and bool
      • ⚠️ format: Implemented for string types: uuid, date, date-time, time and decimal
      • βœ… assertion keywords: as supported by annotated-types
      • βœ… allOf: implemented
      • βœ… anyOf: implemented as union
      • ⚠️ oneOf: treated as anyOf and implemented as Union
      • πŸ—“οΈ not: planned
      • βœ… required: non-required properties are turned to Union[None, $type]
      • additionalProperties:
      • βœ… boolean: supported as pydantic extra: 'allow' or 'forbid'
      • πŸ—“οΈ schema: planned as either a Mapping type or a __pydantic_extra__ field
      • πŸ” enum: ignored; might be implemented for simple types as Literal
      • πŸ“„ description: planned as part of docstr
      • βœ… default: if present, the property type turned to Union[None, $type] and has default value None
      • πŸ” caveat: default values are not to be sent between Web API client and server, instead they are implied by the receiving side. Lapidary could potentially implement generating default values for some cases but they don't necessary need to validate against the schema.
      • βœ… nullable: if true, the property type is turned to Union[None, $type]
      • βœ… readOnly & writeOnly: if either is true, the property type is turned to Union[None, $type] and has default value None; planned as part of docstr
        • ⚠️ caveat: readOnly properties are only to be sent to API server, and writeOnly only to be received by the client. A property might be both required one way, and invalid the other way, which could not be directly represented in Python, except with two or three classes for every schema.
      • πŸ“„ discriminator: planed for use with pydantic discriminated unions
      • πŸ” example: might be used as part of docstr
      • πŸ—“οΈ externalDocs: planned as part of docstr
      • πŸ—“οΈ deprecated: planned
      • ❌ xml: ignored, currently not planned
    • responses
      • πŸ—“οΈ description: planned as part of docstr
      • βœ… headers: if present, used as fields in the response envelope class
      • βœ… content: implemented; used as operation method return type, and a way to resolve model type for a response
      • πŸ” links: ignored; might be used to generate methods in the response envelope
    • βœ… parameters: used in-line in operations
    • πŸ” examples: currently ignored
    • requestBodies
      • πŸ—“οΈ description: planned as part of docstr
      • βœ… content: implemented
      • πŸ—“οΈ required: planned
    • βœ… headers: implemented
    • ⚠️ securitySchemes: implemented with httpx_auth
      • ❌ refreshUrl: not supported
    • πŸ—“οΈ links: planned
    • πŸ—“οΈ callbacks: only planning to generate models from referenced schemas
  • paths: πŸ—“οΈ planned as keys in a TypedDict
    • operations: βœ… mapped to operation methods
      • operationId: βœ… used as method name
      • πŸ—“οΈ summary, description: planned as parts of docstr
      • ❌ servers: ignored
      • parameters
        • βœ… name: OpenAPI parameter names are not unique and might contain characters invalid for python names, therefore they're escaped and suffix-hungarian notation is used to distinguish between cookie, header, path and query parameters
        • βœ… in: implemented, suffix-hungarian notation is used to separate parameters
        • βœ… required: non-required parameters are optional with default value None
        • πŸ—“οΈ deprecated: planned
        • πŸ—“οΈ allowEmptyValue: planned
        • πŸ—“οΈ content: key: planned, value: processed as schema
        • ⚠️ style: partially implemented
        • πŸ—“οΈ allowReserved: planned
        • βœ… schema: implemented
        • πŸ” example & examples: considered