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

Add option to deconflict errors with same status code for OpenAPI #1995

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Sep 28, 2023

This PR closes #1649. See also: #1265.

It re-introduces a subset of the changes that were added previously in #1304, but later reverted in #1334. The docs changes from #1304 were not entirely reverted, so those are modified here to reflect the new changes, which include only allowing for the oneOf option to deconflict errors. Contrary to the docs for the previous PR, oneOf is supported by API Gateway when the oneOf is included within a component schema and referenced via a $ref. Using oneOf within the path content directly is not allowed.

Deconflicting errors is opt-in when converting to OpenAPI by setting the following in smithy-build.json:

{
    "plugins": {
        "openapi": {
            "service": "smithy.example#Weather",
            "onErrorStatusConflict": "oneOf"
        }
    }
}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@srchase srchase requested a review from a team as a code owner September 28, 2023 22:32
@srchase srchase force-pushed the openapi-oneof-errors branch from 99b3734 to 9187dc2 Compare October 2, 2023 16:12
@srchase srchase force-pushed the openapi-oneof-errors branch from 9187dc2 to 5bcf02c Compare October 2, 2023 16:32
@srchase srchase merged commit e7a600b into smithy-lang:main Oct 3, 2023
10 checks passed
@srchase srchase deleted the openapi-oneof-errors branch October 3, 2023 17:11
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.

OpenAPI does not output multiple errors for the same status code
4 participants