Skip to content
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

Open
andreas opened this issue Dec 22, 2023 · 0 comments
Open

JSONAPI support #980

andreas opened this issue Dec 22, 2023 · 0 comments

Comments

@andreas
Copy link

andreas commented Dec 22, 2023

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 and include 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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant