~/talk

How Not to Repeat Yourself - pydantic, YAML, Connexion and all the REST of it.

Talkat PyCon Italia 2023 · 2023-05-25..05-28· [api-design, developer-experience]
links:none on file
slides:none on file

An implementation that replaces hand‑written OpenAPI YAML with an @endpoint decorator that inspects Python: parses docstrings for summaries and param descriptions, uses inspect.getfullargspec and type hints (including return) to decide path vs query params, and emits pydantic models via pydantic.schema for Connexion+Flask. Applied to a syndication API serving ~100M offers from thousands of shops, it generates the OpenAPI used by Swagger UI on the fly and eliminates duplicated YAML and manual schema maintenance.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:20Project context
  3. 3:16The problem of redundancy
  4. 6:12Extracting documentation
  5. 9:11Inspecting Python code
  6. 11:09Modeling with Pydantic
  7. 13:59Automating schema generation
  8. 15:14Decorator-driven API design
  9. 19:44Conclusion
  10. 20:28Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.