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

Enum value deletion/update is not detected as a breaking change by check-breaking #205

Closed
blva opened this issue Mar 23, 2023 · 1 comment

Comments

@blva
Copy link
Contributor

blva commented Mar 23, 2023

Describe the bug

Previously, the breaking-only flag would detect any enum value deletion as a breaking change, which makes sense as this can cause customer's automation to break if they rely on an enum value in a request. -check-breaking does not classisfy that as a breaking change. We'd like to either have the check under -check-breaking or have it as a custom check.

To Reproduce
Steps to reproduce the behavior:

  1. Run oasdiff -base base.yaml -revision revision.yaml -check-breaking
  2. With base.yaml
openapi: 3.0.1
info:
  title: Test API
tags:
- name: Tests
  description: Test tag.
paths:
  /api/deleteEnumTest:
    get:
      tags:
      - Tests
      summary: This is a test
      description: Test description.
      operationId: getTest
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                description: Enum values
                enum:
                - VALUE_1
                - VALUE_2
                - VALUE_3
  1. With revision.yaml
openapi: 3.0.1
info:
  title: Test API
tags:
- name: Tests
  description: Test tag.
paths:
  /api/deleteEnumTest:
    get:
      tags:
      - Tests
      summary: This is a test
      description: Test description.
      operationId: getTest
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
                description: Enum values
                enum:
                - VALUE_1
                - VALUE_2
                - VALUE_5
  1. Recieve

Expected behavior
Similar to -breaking-only

paths:
    modified:
        /api/atlas/v2/deleteEnumTest:
            operations:
                modified:
                    GET:
                        responses:
                            modified:
                                "200":
                                    content:
                                        mediaTypeModified:
                                            application/json:
                                                schema:
                                                    enum:
                                                        deleted:
                                                            - VALUE_3
endpoints:

Desktop (please complete the following information):

  • OS: Mac OS Monterey
@blva blva changed the title Enum value deletion is not detected as a breaking change by check-breaking Enum value deletion/update is not detected as a breaking change by check-breaking Mar 23, 2023
@reuvenharrison
Copy link
Collaborator

Removing an enum value in a response in not considered breaking.

This issue was closed.
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

No branches or pull requests

2 participants