-
Notifications
You must be signed in to change notification settings - Fork 5
Description
I've been generating typescript types from the backend's OpenApi.json spec file with the openapi-typescript library. Problem is if a schema is declared with "default": [] and lacks "nullable": true, openapi-typescript interprets that combination as "always defined" instead of optional. For example, the RolesQueryParameter type should have an optional 'workspace_id?', but the generated TypeScript file defines it as required.
@kjlippold I'm not sure the easiest way to resolve this. I'm hoping there's a straightforward way to update Pydantic models to make optional fields more explicit in the generated OpenApi.json file, but if not we'll need to think of another way to fix this. For now, I can disable TypeScript for specific @hydroserver/client calls, but in production the Types should match the backend exactly.