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

W-10547493: added test of conversion cycle with multiple operations w… #1323

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"swagger": "2.0",
"info": {
"title": "Some tittle",
"version": "1"
},
"paths": {
"/something/{someOtherThing}": {
"get": {
"operationId": "someOtherThingGET",
"produces": [
"application/json"
],
"parameters": [
{
"name": "someOtherThing",
"description": "someOtherThing",
"required": true,
"in": "path",
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"x-amf-mediaType": "application/json",
"schema": {
"type": "string"
}
}
}
},
"put": {
"operationId": "someOtherThingPUT",
"produces": [
"application/json"
],
"parameters": [
{
"name": "someOtherThing",
"description": "someOtherThing",
"required": true,
"in": "path",
"type": "integer"
}
],
"responses": {
"200": {
"description": "OK",
"x-amf-mediaType": "application/json",
"schema": {
"type": "string"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#%RAML 1.0
annotationTypes:
amf-serverDescription:
type: any
amf-exclusiveMinimum:
type: any
amf-binding:
type: any
amf-pattern:
type: any
amf-payloads:
type: any
amf-exclusiveMaximum:
type: any
amf-consumes:
type: any
amf-additionalProperties:
type: any
amf-or:
type: any
amf-url:
type: any
amf-externalDocs:
type: any
amf-flow:
type: any
amf-oasDeprecated:
type: any
amf-contact:
type: any
amf-multipleOf:
type: any
amf-xor:
type: any
amf-not:
type: any
amf-callbacks:
type: any
amf-produces:
type: any
amf-format:
type: any
amf-license:
type: any
amf-summary:
type: any
amf-responses:
type: any
amf-maximum:
type: any
amf-tags:
type: any
amf-dependencies:
type: any
amf-readOnly:
type: any
amf-tuple:
type: any
amf-examples:
type: any
amf-collectionFormat:
type: any
amf-termsOfService:
type: any
amf-servers:
type: any
amf-xone:
type: any
amf-defaultResponse:
type: any
amf-baseUriParameters:
type: any
amf-parameters:
type: any
amf-minimum:
type: any
amf-recursive:
type: any
amf-and:
type: any
title: Some tittle
version: "1"
/something/{someOtherThing}:
get:
displayName: someOtherThingGET
(amf-produces):
- application/json
(amf-baseUriParameters):
someOtherThing:
description: someOtherThing
required: true
type: string
responses:
"200":
description: OK
body:
application/json:
type: string
put:
displayName: someOtherThingPUT
(amf-produces):
- application/json
(amf-baseUriParameters):
someOtherThing:
description: someOtherThing
required: true
type: integer
responses:
"200":
description: OK
body:
application/json:
type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"swagger": "2.0",
"info": {
"title": "Some tittle",
"version": "1"
},
"paths": {
"/something/{someOtherThing}": {
"get": {
"operationId": "someOtherThingGET",
"produces": [
"application/json"
],
"parameters": [
{
"name": "someOtherThing",
"in": "path",
"description": "someOtherThing",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
},
"put": {
"operationId": "someOtherThingPUT",
"produces": [
"application/json"
],
"parameters": [
{
"name": "someOtherThing",
"in": "path",
"description": "someOtherThing",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,33 @@ class CompatibilityCycleGoldenTest extends ResolutionTest {
}

test("Raml with file request payload converted to oas with valid consumes mediatype") {
cycle("raml10/request-with-type-file-in-body.raml",
cycle(
"raml10/request-with-type-file-in-body.raml",
"cycled-apis/oas20/request-with-type-file-in-body.json",
Raml10YamlHint,
Oas20JsonHint,
transformWith = Some(Oas20))
transformWith = Some(Oas20)
)
}

test("OAS 2.0 with multiple operations in endpoint each one with uri parameter") {
cycle(
"oas20/operations-uri-param.json",
"cycled-apis/raml/operations-uri-param.raml",
Oas20JsonHint,
Raml10YamlHint,
transformWith = Some(Raml10)
)
}

test("OAS 2.0 with multiple operations in endpoint each one with uri parameter cycle back") {
cycle(
"cycled-apis/raml/operations-uri-param.raml",
"cycled-apis/oas20/operations-uri-param.json",
Raml10YamlHint,
Oas20JsonHint,
transformWith = Some(Oas20)
)
}

}