You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python dataclasses (and at a higher level, pydantic) allow convenient validation and serialization of JSON request/reply schemas. I think we can try this out incrementally with new APIs and slowly adopt it more as we like it. It should have no user-facing consequences (aside from the dependency, see below).
Alternative options
Just use dataclasses (stdlib, avoids current issues around the pydantic v2 migration, which will affect users because it would be installed in the single-user environment)
Keep manual JSON validation (tedious, I started looking into this for user-initiated sharing #4594 after writing yet another JSON model validation method
Who would use this feature?
Mostly JupyterHub maintainers, but especially with pydantic, it could be used to generate accurate docs, as is done with FastAPI.
The text was updated successfully, but these errors were encountered:
This is currently done on the sharing endpoints only. I had a pretty good experience, so I think we can iteratively apply these to the other endpoints.
Proposed change
Python dataclasses (and at a higher level, pydantic) allow convenient validation and serialization of JSON request/reply schemas. I think we can try this out incrementally with new APIs and slowly adopt it more as we like it. It should have no user-facing consequences (aside from the dependency, see below).
Alternative options
Who would use this feature?
Mostly JupyterHub maintainers, but especially with pydantic, it could be used to generate accurate docs, as is done with FastAPI.
The text was updated successfully, but these errors were encountered: