Skip to content

Is there a way to resolve duplicate type definition errors with deprecated properties? #1301

Answered by ykokw
ykokw asked this question in Q&A
Discussion options

You must be logged in to vote

I considered removing deprecated properties from the list of properties to automatic generation as a workaround.

In orval.config.ts, I set the following transformer to input.override.transformer to filter out deprecated properties from the request body and component properties.
(In my own reproduction repository, there were only duplicate errors occurring with the request body and Pet properties, but it seems necessary to handle it for responses as well if needed.)

const filterDeprecated = (schema) =>
  Object.fromEntries(
    Object.entries(schema || {}).filter(
      ([_, schemaContent]) => schemaContent.deprecated !== true
    )
  );

const transformComponentsSchemas = (schemas) =>
  O…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ykokw
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by melloware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
workaround A workaround has been provided
2 participants