Skip to content

Commit

Permalink
v6.3.5 (#665)
Browse files Browse the repository at this point in the history
* feat: upgrade deps, add tests

* 6.3.5

* test: add await next frame to test
  • Loading branch information
twoplustwoone authored Dec 9, 2020
1 parent a340ad1 commit 7160f1d
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 107 deletions.
3 changes: 2 additions & 1 deletion demo/apis.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"models/oas-3-api/oas-3-api.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },
"models/async-api/async-api.yaml": "ASYNC 2.0",
"models/APIC-553/APIC-553.raml": "RAML 1.0",
"models/APIC-554/APIC-554.raml": "RAML 1.0"
"models/APIC-554/APIC-554.raml": "RAML 1.0",
"models/APIC-557/APIC-557.yaml": "OAS 3.0"
}
4 changes: 4 additions & 0 deletions demo/element/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class ApicApplication extends DemoBase {
['oas-3-api', 'OAS 3 API'],
['async-api', 'AsyncAPI'],
['APIC-553', 'APIC-553'],
['APIC-557', 'APIC-557'],
['APIC-558', 'APIC-558'],
];

this.toggleConsoleMenu = this.toggleConsoleMenu.bind(this);
Expand Down Expand Up @@ -52,8 +54,10 @@ class ApicApplication extends DemoBase {
</div>
<api-console
allowcustombaseuri
redirecturi="https://auth.advancedrestclient.com/oauth-popup.html"
oauth2clientid="821776164331-rserncqpdsq32lmbf5cfeolgcoujb6fm.apps.googleusercontent.com">
<anypoint-item slot="custom-base-uri" value="http://example-ms.com">Mocking Service</anypoint-item>
</api-console>
<xhr-simple-request></xhr-simple-request>
Expand Down
254 changes: 254 additions & 0 deletions demo/models/APIC-557/APIC-557.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
openapi: "3.0.0"
externalDocs:
url: petstore.com
description: Pet Store website
info:
version: 1.0.0
contact:
name: John Smith
email: [email protected]
url: petstore.com
title: OpenAPI Spec 3.0 Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
description: prodcutive env
- url: http://qa.petstore.swagger.io/v1
description: qa env
- url: http://dev.petstore.swagger.io/v1
description: dev env

components:

responses:
"200":
description: "ok"
content:
application/json:
schema:
$ref: "#/components/schemas/Pet"
example:
$ref: "#/components/schemas/Pet"
links:
UserRepositories:
# returns array of '#/components/schemas/repository'
operationRef: 'https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get'
parameters:
username: $response.body#/username
securitySchemes:
api_key:
type: "apiKey"
description: Api key security
name: "api_key"
in: "header"
petstore_auth:
type: oauth2
flows:
implicit:
authorizationUrl: https://example.com/api/oauth/dialog
scopes:
write:pets: modify pets in your account
read:pets: read your pets
authorizationCode:
authorizationUrl: https://example.com/api/oauth/dialog
tokenUrl: https://example.com/api/oauth/token
scopes:
write:pets: modify pets in your account
read:pets: read your pets
examples:
petsArrayExample:
summary: s
description: aaa
value:
-
id: 233
name: Archie
-
id: 455
name: Bella
petExample1:
description: pet1
value:
id: 2333
name: Max
petExample2:
description: pet2
value:
id: 344
name: Brea
errorExample:
value:
code: 1400
message: Unexpected error
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
Pets:
type: array
items:
$ref: "#/components/schemas/Pet"
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
paths:
/pets:
get:
summary: List all pets
operationId: listPets
tags:
- pets
parameters:
- name: limit
in: query
description: how many items to return at one time (max 100)
required: false
schema:
type: integer
format: int32
responses:
"200":

description: A paged array of pets
headers:
x-next:
description: A link
schema:
type: string
content:
application/json:
schema:
$ref: "#/components/schemas/Pets"
examples:
pet1:
$ref: "#/components/examples/petsArrayExample"

post:
summary: Create a pet

requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/Pet"

examples:
e1:
$ref: "#/components/examples/petExample1"


tags:
- pets
responses:
"201":
description: Null response
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
examples:
err1:
$ref: "#/components/examples/errorExample"
/pets/{petId}:
get:
summary: Info for specific pet
operationId: showPetById
tags:
- pets
parameters:
- name: petId
in: path
required: true
description: The id of the pet to retrieve
schema:
type: string
responses:
default:

$ref: "#/components/responses/200"
"200":
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/Pet"

examples:
one:
$ref: "#/components/examples/petExample1"
/users/{id}:
parameters:
- name: id
in: path
required: true
description: the user identifier, as userId
schema:
type: string
get:
responses:

'200':
description: the user being returned
content:
application/json:
schema:
type: object
properties:
uuid: # the unique user id
type: string
format: uuid
links:
address:
# the target link operationId
operationId: getUserAddress
parameters:
# get the `id` field from the request path parameter named `id`
userId: $request.path.id
# the path item of the linked operation
/users/{userid}/address:
parameters:
- name: userid
in: path
required: true
description: the user identifier, as userId
schema:
type: string
# linked operation
get:
operationId: getUserAddress
responses:
'200':
description: the user's address
content:
application/json:
schema:
type: object
properties:
addressLine1:
type: string
country:
type: string
example:
addressLine1: Washintong 3434
country: USA
Loading

0 comments on commit 7160f1d

Please sign in to comment.