-
Notifications
You must be signed in to change notification settings - Fork 59
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
Ignore parameter name changes #202
Comments
Hi @EpicWink , |
@reuvenharrison here: a.openapi.ymlopenapi: 3.0.0
info:
title: My API
version: '0.1'
paths:
/books/{bookId}:
parameters:
- in: path
name: bookId
description: book ID
required: true
schema:
title: ID
type: string
get:
summary: get book details
description: get details for a book
responses:
'200':
description: successfully retrieved book details
content:
application/json:
schema:
title: book details
type: object
required:
- author
- title
properties:
author:
title: book author name
type: string
title:
title: book title
type: string b.openapi.ymlopenapi: 3.0.0
info:
title: My API
version: '0.1'
paths:
/books/{id}:
parameters:
- in: path
name: id
description: book ID
required: true
schema:
title: ID
type: string
get:
summary: get book details
description: get details for a book
responses:
'200':
description: successfully retrieved book details
content:
application/json:
schema:
title: book details
type: object
required:
- author
- title
properties:
author:
title: book author name
type: string
title:
title: book title
type: string Textdocker run -v $(pwd):/wd -w /wd --rm -i tufin/oasdiff:latest -format text -base a.openapi.yml -revision b.openapi.yml
YAMLdocker run -v $(pwd):/wd -w /wd --rm -i tufin/oasdiff:latest -format yaml -base a.openapi.yml -revision b.openapi.yml paths:
added:
- /books/{id}
deleted:
- /books/{bookId}
endpoints:
added:
- method: GET
path: /books/{id}
deleted:
- method: GET
path: /books/{bookId} |
See #212 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
I have the same (in theory) API spec generated from two different sources, which have different names for the URL path parameters. This causes oasdiff to consider those endpoints to be both new and deleted, even though the API is not any different.
Proposal
Treat URL path parameter names as opaque, and equivalent between the base and revision specs (if the parameters have the same schema, eg the same (lack of) reg-ex).
Alternatives
I currently manually update the OpenAPI spec to have matching path parameters, but this is prone to error.
The text was updated successfully, but these errors were encountered: