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

Support deprecated on fields in the OpenAPI conversion #2221

Merged
merged 14 commits into from
Apr 11, 2024

Conversation

miguel-vila
Copy link
Contributor

Background

It seems that the OpenAPI transformation doesn't set deprecated: true for members that are annotated as @deprecated(...).

Started by just adding a failing test to check that it makes sense. If this is something that is not expected I will proceed to try a fix.

@miguel-vila miguel-vila requested a review from a team as a code owner March 29, 2024 17:20
@miguel-vila miguel-vila requested a review from hpmellema March 29, 2024 17:20
@miguel-vila
Copy link
Contributor Author

Might need a bit of guidance on this one. At 66b3462 I'm setting the deprecated field for json schema for what I think are member fields. This seems to break cloudformation tests in CfnSchemasTest, how can this be separated?

@kstich
Copy link
Contributor

kstich commented Apr 9, 2024

"deprecated" was added in Draft 2019-09 (formerly Draft 8) and Smithy supports Draft 7 and Draft 2020-12. This means the behavior you've added needs to be controlled by the JsonSchemaVersion.

CloudFormation uses Draft 7, so those tests should pass when this field is not being added for that JSON Schema version.

@kstich kstich self-requested a review April 9, 2024 16:52
@miguel-vila
Copy link
Contributor Author

@kstich thanks, I made some changes, including only setting it when the json schema version != DRAFT07, which I assume will work meaning set it if version is "greater" than DRAFT07.

miguel-vila and others added 4 commits April 11, 2024 10:26
Co-authored-by: Kevin Stich <kevin@kstich.com>
Co-authored-by: Kevin Stich <kevin@kstich.com>
Co-authored-by: Kevin Stich <kevin@kstich.com>
Co-authored-by: Kevin Stich <kevin@kstich.com>
@kstich kstich merged commit 1f0cf18 into smithy-lang:main Apr 11, 2024
13 checks passed
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.

2 participants