openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

[Feature] Exclude deprecated properties

Open elliotdickison opened this issue 1 year ago • 4 comments

I'd like a flag that causes deprecated properties to be excluded from the generated types. The use-case would be when you need to keep a property around in the API spec for backwards compatibility with older clients but you want to discourage any updated clients from accessing it. For the flag I'm thinking:

--includeDeprecatedModelProperties <value>  Include deprecated properties in exported models (default: true)

elliotdickison avatar Sep 15 '22 00:09 elliotdickison

Should be able to submit a PR shortly

elliotdickison avatar Sep 15 '22 00:09 elliotdickison

any news?

atila29 avatar Nov 06 '23 14:11 atila29

Here's what I came up with: https://github.com/ferdikoomen/openapi-typescript-codegen/compare/master...elliotdickison:openapi-typescript-codegen:exclude-deprecated-properties

Never polished or submitted a PR because of #1276

elliotdickison avatar Nov 06 '23 14:11 elliotdickison

@elliotdickison have you tried https://www.npmjs.com/package/eslint-plugin-deprecation?

mrlubos avatar Mar 16 '24 04:03 mrlubos