Tripletex / tripletex-api2

Tripletex API 2 resources and examples
MIT License
38 stars 43 forks source link

Optional types in schema, ex: GET /employee returns values where id is optional #84

Open thhermansen opened 1 year ago

thhermansen commented 1 year ago

We are using https://openapi-ts.pages.dev/ to generate client code and there are optional types in Tripletex's swagger schema which I believe could have been marked as required. Example Employee and it's id:

image

This results in generated code where id is optional:

image

I'm guessing this may have to do something with type being used in multiple contexts, like when you POST a new employee? But it would have been nice to have accurate types for different operations :)