Skip to content

Specbook 0.6.1: optional fields in OpenAPI 3.1

Choose a tag to compare

@ajaishankar ajaishankar released this 18 Oct 23:59
· 41 commits to main since this release

A fix for specs that mark optional fields the OpenAPI 3.1 way, which is how FastAPI and Pydantic v2 write every Optional field.

Fixes

  • No false "differences from spec" on optional fields. A field written as anyOf: [{ type: integer }, { type: 'null' }] lost its null branch, so a response with "owner_id": null was flagged as "expected integer, got null". It now matches. This affects the viewer, the play panel and the portal.

Also

  • specbook-fastapi 0.1.0 is out on PyPI, as a separate package: pip install specbook-fastapi serves the viewer from a FastAPI app. See Use with FastAPI.
  • The README's example instructions no longer run specbook generate before specbook dev, since dev generates what it needs.

Full changelog: v0.6.0...v0.6.1