| title | OpenAPI 3.2: Emit @deprecated JSDoc for operations using deprecated security schemes | ||
|---|---|---|---|
| parentIssue | 1673 | ||
| labels |
|
||
| assignees | |||
| milestone |
OpenAPI 3.2 allows security schemes to be marked deprecated: true. When a generated handler uses such a scheme, Counterfact should surface this intent to developers as a TypeScript @deprecated JSDoc comment, which causes IDEs to show a strikethrough warning.
OperationTypeCoder in src/typescript-generator/operation-type-coder.ts generates handler types for operations but does not inspect the deprecated flag on security schemes referenced by an operation.
- In
OperationTypeCoder, check whether any security scheme referenced by an operation hasdeprecated: true - If so, emit a
/** @deprecated The security scheme '<name>' is deprecated. */JSDoc comment above the generated handler type
- A generated handler for an operation that references a deprecated security scheme includes a
@deprecatedJSDoc comment - The generated TypeScript passes
tsc --noEmitwithout errors - A handler for an operation that uses only non-deprecated security schemes does not include a
@deprecatedcomment - A unit test covers both the deprecated and non-deprecated cases