-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSONAPI support #980
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Workday Peakon currently has a large REST API based on the JSONAPI specification. We're in the process of defining an OpenAPI spec for the API and using feTS for typing the client/server interaction. However, OpenAPI does not support sparse fieldsets and inclusion of related resources, which results in poor type safety. These features mean that the response type varies depending on the request.
Describe the solution you'd like
In a perfect world, feTS would understand the query parameters
fields
andinclude
from the JSONAPI spec, and alter the response type correspondingly.I've drafted a small example of how this could work as a user of the library here: https://github.com/andreas/fets-jsonapi/blob/master/index.ts
It's unclear to me whether this fits in core feTS, or whether it would be more suitable as an extension library or plugin.
Describe alternatives you've considered
Accepting poor type safety 😭
Additional context
As mentioned, this might be slightly outside the core remit of feTS, but @Urigo encouraged me to open an issue here 🙂
The text was updated successfully, but these errors were encountered: