diff --git a/test/data/swagger-import/raml/swagger_security_conversion2.yaml b/test/data/swagger-import/raml/swagger_security_conversion2.yaml new file mode 100644 index 00000000..a074e66e --- /dev/null +++ b/test/data/swagger-import/raml/swagger_security_conversion2.yaml @@ -0,0 +1,95 @@ +#%RAML 1.0 +title: Security tryout +version: 1.0.0 +baseUri: 'http://mazimi-prod.apigee.net/security' +protocols: + - HTTP +description: '#### Tries out different security configurations' +securitySchemes: + oauth2: + type: OAuth 2.0 + settings: + authorizationUri: 'http://swagger.io/api/oauth/dialog' + accessTokenUri: '' + authorizationGrants: + - implicit + scopes: + - write:pets + - read:pets + basicAuth: + type: Basic Authentication + description: HTTP Basic Authentication. Works over `HTTP` and `HTTPS` + internalApiKey: + type: Pass Through + description: Api Key Authentication + describedBy: + queryParameters: + api_key: + type: string +/getApiKey: + displayName: getApiKey + get: + displayName: GET_getApiKey + responses: + '200': + description: 'InternalApiKey. Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`' + queryParameters: + count: + description: Count of media to return. + type: integer + displayName: Count of media to return. + max_id: + description: Return media earlier than this max_id.s + type: integer + displayName: Return media earlier than this max_id.s + min_id: + description: Return media later than this min_id. + type: integer + displayName: Return media later than this min_id. + securedBy: + - internalApiKey +/getBasicAuth: + displayName: getBasicAuth + get: + displayName: GET_getBasicAuth + responses: + '200': + description: 'Basic Auth. Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`' + queryParameters: + count: + description: Count of media to return. + type: integer + displayName: Count of media to return. + max_id: + description: Return media earlier than this max_id.s + type: integer + displayName: Return media earlier than this max_id.s + min_id: + description: Return media later than this min_id. + type: integer + displayName: Return media later than this min_id. + securedBy: + - basicAuth +/getOauth2Auth: + displayName: getOauth2Auth + get: + displayName: GET_getOauth2Auth + responses: + '200': + description: 'Oauth2 Authorization. Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`' + queryParameters: + count: + description: Count of media to return. + type: integer + displayName: Count of media to return. + max_id: + description: Return media earlier than this max_id.s + type: integer + displayName: Return media earlier than this max_id.s + min_id: + description: Return media later than this min_id. + type: integer + displayName: Return media later than this min_id. + securedBy: + - oauth2: + scopes: [ read:pets ] diff --git a/test/data/swagger-import/swagger/swagger_security_conversion2.json b/test/data/swagger-import/swagger/swagger_security_conversion2.json new file mode 100644 index 00000000..a49ff6ba --- /dev/null +++ b/test/data/swagger-import/swagger/swagger_security_conversion2.json @@ -0,0 +1,140 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0.0", + "title": "Security tryout", + "description": "#### Tries out different security configurations" + }, + "schemes": [ + "http" + ], + "host": "mazimi-prod.apigee.net", + "basePath": "/security", + "paths": { + "/getBasicAuth": { + "get": { + "parameters": [ + { + "name": "count", + "in": "query", + "description": "Count of media to return.", + "type": "integer" + }, + { + "name": "max_id", + "in": "query", + "description": "Return media earlier than this max_id.s", + "type": "integer" + }, + { + "name": "min_id", + "in": "query", + "description": "Return media later than this min_id.", + "type": "integer" + } + ], + "security": [ + { + "basicAuth": [] + } + ], + "responses": { + "200": { + "description": "Basic Auth. Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`" + } + } + } + }, + "/getApiKey": { + "get": { + "parameters": [ + { + "name": "count", + "in": "query", + "description": "Count of media to return.", + "type": "integer" + }, + { + "name": "max_id", + "in": "query", + "description": "Return media earlier than this max_id.s", + "type": "integer" + }, + { + "name": "min_id", + "in": "query", + "description": "Return media later than this min_id.", + "type": "integer" + } + ], + "security": [ + { + "internalApiKey": [] + } + ], + "responses": { + "200": { + "description": "InternalApiKey. Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`" + } + } + } + }, + "/getOauth2Auth": { + "get": { + "parameters": [ + { + "name": "count", + "in": "query", + "description": "Count of media to return.", + "type": "integer" + }, + { + "name": "max_id", + "in": "query", + "description": "Return media earlier than this max_id.s", + "type": "integer" + }, + { + "name": "min_id", + "in": "query", + "description": "Return media later than this min_id.", + "type": "integer" + } + ], + "security": [ + { + "oauth2": [ + "read:pets" + ] + } + ], + "responses": { + "200": { + "description": "Oauth2 Authorization. Will send `Authenticated` if authentication is succesful, otherwise it will send `Unauthorized`" + } + } + } + } + }, + "securityDefinitions": { + "basicAuth": { + "type": "basic", + "description": "HTTP Basic Authentication. Works over `HTTP` and `HTTPS`" + }, + "internalApiKey": { + "type": "apiKey", + "in": "query", + "name": "api_key", + "description": "Api Key Authentication" + }, + "oauth2": { + "type": "oauth2", + "authorizationUrl": "http://swagger.io/api/oauth/dialog", + "flow": "implicit", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } +}