Skip to content

openapi3.errors.SpecError: Expected components.schemas.Foobar.properties.foobar.default to be one of [<class 'float'>], got <class 'int'> #122

@luckydonald

Description

@luckydonald

Based on https://demo.grocy.info/api/openapi/specification:

{
  "openapi": "3.1.0",
  "components": {
    "schemas": {
      "Product": {
        "type": "object",
        "properties": {
          "min_stock_amount": {
            "type": "number",
            "minimum": 0,
            "default": 0
          }
        },
        "example": {
          "min_stock_amount": "8"
        }
      }
    }
  }
}

Produces

openapi3.errors.SpecError: Expected components.schemas.Product.properties.min_stock_amount.default 
to be one of [<class 'float'>], got <class 'int'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions