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

fix(#zimic): support declaring http bodies using interfaces (#350) #358

Merged
merged 26 commits into from
Aug 25, 2024

Conversation

diego-aquino
Copy link
Member

@diego-aquino diego-aquino commented Aug 24, 2024

Fixes

  • [#zimic] Added support to declare HTTP schema bodies using interface. This became no longer possible after HTTP interceptor strict JSON validation #106. Zimic now is less strict about the validation of JSON bodies in HTTP schemas, due to limitations in TypeScript. Due to the type error message being somewhat cryptic ("Index signature is missing in type X"), we believe allowing type and interface and serializing JSON body types before use is a good compromise.
  • Deprecated HttpResponseSchemaByStatusCode.Strict in favor of HttpResponseSchemaByStatusCode.
  • Added HttpFormDataSerialized and updated the typegen code to wrap this type around raw schemas. This is to ensure that Zimic correctly understands schemas not strictly correct, as sometimes happens for search params and headers.

Development

  • [#zimic] Updated tsconfig.json to ignore interceptor/*.d.ts and http/*.d.ts in type checking and linting.
  • [#eslint] Disabled the rule "no-redeclare", which is already enforced by the TypeScript copiler.

Closes #350.

@diego-aquino diego-aquino force-pushed the @diego-aquino/350-interfaces-in-http-schemas branch from acbc51f to b6d4010 Compare August 25, 2024 00:38
@diego-aquino diego-aquino merged commit f24d8e4 into canary Aug 25, 2024
15 checks passed
@diego-aquino diego-aquino deleted the @diego-aquino/350-interfaces-in-http-schemas branch August 25, 2024 00:42
Copy link
Contributor

Released in v0.9.1 🎉

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

Successfully merging this pull request may close these issues.

Support declaring bodies using interfaces in HTTP schemas
1 participant