Skip to content

Commit

Permalink
Failing test for #464
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Feb 26, 2023
1 parent 5105f0b commit 485a6d5
Show file tree
Hide file tree
Showing 23 changed files with 418 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.openapitools.openapidiff.core;

import static org.openapitools.openapidiff.core.TestUtils.assertOpenApiAreEquals;

import org.junit.jupiter.api.Test;

public class ExternalRefsTest {
@Test
public void testDiffSame() {
assertOpenApiAreEquals(
"issue-464/source/specification/openapi.yaml",
"issue-464/destination/specification/openapi.yaml");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
status: up
date_time: "2021-09-04T21:00:00Z"
api_name: api
api_version: 1.1.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: /problem/bad-request
title: Bad Request
status: 400
detail: Invalid or malformed request syntax
instance: /problem/bad-request#invalid-or-malformed-request-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: /problem/data-not-found
title: Data not found
status: 404
detail: Requested data not found
instance: /problem/data-not-found#requested-data-not-found
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: /problem/internal-server-error
title: Internal Server Error
status: 500
detail: A technical exception occurred within the application
instance: /problem/internal-server-error#a-technical-exception-occurred-within-the-application
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
products:
- id: Prod-000001
status: Active
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
description: Model for response from call to GET products requiring an array of products to be returned.
title: GetProductResponse
properties:
Products:
type: array
items:
$ref: Product.yaml

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: object
description: Product Data Model
title: ''
properties:
id:
type: string
example: Prod-00001
description: An unique Id of product record
status:
type: string
example: Active
enum:
- Active
- Expired
description: Defines the current status of the product
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
type: object
properties:
type:
type: string
format: uri-reference
description: |
A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferenceable and point to a human-readable documentation nor globally unique for the problem type.
default: about:blank
example: /problem/connection-error
title:
type: string
description: |
A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
example: Service Unavailable
status:
type: integer
format: int32
description: |
The HTTP status code generated by the origin server for this occurrence of the problem.
minimum: 100
maximum: 600
exclusiveMaximum: true
example: 503
detail:
type: string
description: |
A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
example: Connection to database timed out
instance:
type: string
format: uri-reference
description: |
A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code.
example: /problem/connection-error#token-info-read-timed-out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: correlation-id
in: header
schema:
type: string
example: 4cbc91f7-11d3-4019-a92b-64a54964b470
description: A unique identifier attached to request and responses as header that allows reference to a particular transaction or chain of transactions. Based on UUID conforming to RFC 4122 - https://datatracker.ietf.org/doc/html/rfc4122
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: traceparent
in: header
schema:
type: string
example: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
description: The traceparent HTTP header field identifies the incoming request in a tracing system. Conforming to OpenTelemetry (OTel) Trace Context
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
openapi: 3.0.0
info:
title: service/someapi/v1
version: 1.1.2
contact:
name: john.doe
email: [email protected]
description: Provide description of the API
servers:
- url: 'https://api.acme.com/service/someapi/v1'
paths:
/products:
get:
summary: Query Products
operationId: get-products
responses:
'200':
$ref: '#/components/responses/200-GetProductResponse'
'400':
$ref: '#/components/responses/400'
'404':
$ref: '#/components/responses/404'
'500':
$ref: '#/components/responses/500'
description: Get Product Records
parameters:
- $ref: ./common/parameters/correlation-id.yaml
- $ref: ./common/parameters/traceparent.yaml
tags:
- applicant
components:
schemas:
Error:
$ref: common/models/error.yaml
GetProductResponse:
$ref: ./common/models/GetProductResponse.yaml
securitySchemes:
Oauth:
type: oauth2
description: Oauth Security Token Enforcement for internal production environment.
flows:
clientCredentials:
tokenUrl: 'https://api.acme.com/auth/app/v1/token'
scopes:
scope: READ
responses:
'400':
description: 400 Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
400 Bad Request:
value:
$ref: common/examples/400.yaml
headers:
correlation-id:
schema:
type: string
description: An ID passed by clients to correlate multiple API requests.
'404':
description: 404 Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
404 Not Found:
value:
$ref: common/examples/404.yaml
headers:
correlation-id:
schema:
type: string
description: An ID passed by clients to correlate multiple API requests.
'500':
description: 500 Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
500 Internal Server Error:
value:
$ref: common/examples/500.yaml
headers:
correlation-id:
schema:
type: string
description: An ID passed by clients to correlate multiple API requests.
200-GetProductResponse:
description: Get Product Response
content:
application/json:
schema:
$ref: '#/components/schemas/GetProductResponse'
examples:
200 - Sample Data:
value:
$ref: common/examples/Product/200-GetProductResponse.yaml
headers:
correlation-id:
schema:
type: string
description: An ID passed by clients to correlate multiple API requests.
security:
- Oauth: []
tags:
- name: applicant
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
status: up
date_time: "2021-09-04T21:00:00Z"
api_name: api
api_version: 1.1.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: /problem/bad-request
title: Bad Request
status: 400
detail: Invalid or malformed request syntax
instance: /problem/bad-request#invalid-or-malformed-request-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: /problem/data-not-found
title: Data not found
status: 404
detail: Requested data not found
instance: /problem/data-not-found#requested-data-not-found
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: /problem/internal-server-error
title: Internal Server Error
status: 500
detail: A technical exception occurred within the application
instance: /problem/internal-server-error#a-technical-exception-occurred-within-the-application
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
products:
- id: Prod-000001
status: Active
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
description: Model for response from call to GET products requiring an array of products to be returned.
title: GetProductResponse
properties:
Products:
type: array
items:
$ref: Product.yaml

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type: object
description: Product Data Model
title: ''
properties:
id:
type: string
example: Prod-00001
description: An unique Id of product record
status:
type: string
example: Active
enum:
- Active
- Expired
description: Defines the current status of the product
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
type: object
properties:
type:
type: string
format: uri-reference
description: |
A URI reference that uniquely identifies the problem type only in the context of the provided API. Opposed to the specification in RFC-7807, it is neither recommended to be dereferenceable and point to a human-readable documentation nor globally unique for the problem type.
default: about:blank
example: /problem/connection-error
title:
type: string
description: |
A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
example: Service Unavailable
status:
type: integer
format: int32
description: |
The HTTP status code generated by the origin server for this occurrence of the problem.
minimum: 100
maximum: 600
exclusiveMaximum: true
example: 503
detail:
type: string
description: |
A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
example: Connection to database timed out
instance:
type: string
format: uri-reference
description: |
A URI reference that identifies the specific occurrence of the problem, e.g. by adding a fragment identifier or sub-path to the problem type. May be used to locate the root of this problem in the source code.
example: /problem/connection-error#token-info-read-timed-out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: correlation-id
in: header
schema:
type: string
example: 4cbc91f7-11d3-4019-a92b-64a54964b470
description: A unique identifier attached to request and responses as header that allows reference to a particular transaction or chain of transactions. Based on UUID conforming to RFC 4122 - https://datatracker.ietf.org/doc/html/rfc4122
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: traceparent
in: header
schema:
type: string
example: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
description: The traceparent HTTP header field identifies the incoming request in a tracing system. Conforming to OpenTelemetry (OTel) Trace Context
Loading

0 comments on commit 485a6d5

Please sign in to comment.