Optional types in schema, ex: GET /employee returns values where id is optional
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- openapi
- Domain
- api, backend-api-design
Research direction
Start with the OpenAPI/Swagger schema for Employee and compare the GET /employee response with the POST request model. Inspect how shared types mark id as optional, then use openapi-ts to verify the generated types. Done means the schema accurately distinguishes required response fields from fields that may be absent when creating an employee.
Written by the indexing model from the issue text.
Description
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:
This results in generated code where id is optional:
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 :)
- Dominant language
- No language data
- Stars
- 49
- Forks
- 47
- Avg merge
- 1h 1m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Tripletex/tripletex-api2
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Tripletex/tripletex-api2#135 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Tripletex/tripletex-api2#133 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Tripletex/tripletex-api2#130 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Tripletex/tripletex-api2#127 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Tripletex/tripletex-api2#126 · 1 reaction ·
All issues in Tripletex/tripletex-api2
Similar issues
-
[Feature]:Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
thephpleague/commonmark#1159 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
EchoTools/nevr-runtime#117 · 2 comments ·
Maintainers usually reply within 1 day
-
Proxy drops log notifications from backends that don't send FastMCP's msg/extra dictPossibly taken @asasemahmed claimed this today. Openbug server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
llvm/offload-test-suite#1554 ·
Maintainers usually reply within 1 day