Skip to content

Add AsyncAPI support for URI #9

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

Merged
merged 11 commits into from
Nov 27, 2020
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
44 changes: 44 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: tests

env:
FORCE_COLOR: 1

on:
push:
pull_request:
branches:
- stage
- master
jobs:
test_linux:
name: ${{ matrix.os }} (${{ matrix.browser }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: microsoft/playwright-github-action@v1
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
# test_win:
# name: "Windows"
# strategy:
# fail-fast: false
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: 14
# - uses: microsoft/playwright-github-action@v1
# - name: Install dependencies
# run: npm ci
# - name: Run tests
# run: npm test
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion demo/anypoint.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
return;
}
}
const webApi = app.$.helper._computeWebApi(app.amfModel);
const webApi = app.$.helper._computeApi(app.amfModel);
const endpoint = app.$.helper._computeEndpointModel(webApi, eId);
app.endpoint = endpoint;
app.selectedShape = id;
Expand Down
3 changes: 2 additions & 1 deletion demo/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"nexmo-sms-api/nexmo-sms-api.raml": "RAML 1.0",
"exchange-experience-api/exchange-experience-api.raml": "RAML 0.8",
"google-drive-api/google-drive-api.raml": "RAML 1.0",
"multi-server/multi-server.yaml": { "type": "OAS 3.0", "mime": "application/yaml" }
"multi-server/multi-server.yaml": { "type": "OAS 3.0", "mime": "application/yaml" },
"async-api/async-api.yaml": "ASYNC 2.0"
}
95 changes: 95 additions & 0 deletions demo/async-api/async-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
asyncapi: '2.0.0'
info:
title: Hello world application
version: '0.1.0'
servers:
production:
url: broker.mycompany.com
protocol: amqp
protocolVersion: 1.0.0
description: This is "My Company" broker.
security:
- oAuth2: []
- foo: []
channels:
hello:
publish:
message:
$ref: '#/components/messages/hello-msg'
goodbye:
publish:
message:
$ref: '#/components/messages/goodbye-msg'
components:
messages:
hello-msg:
headers:
$ref: '#/components/schemas/hello-headers'
payload:
type: object
properties:
name:
type: string
sentAt:
$ref: '#/components/schemas/sent-at'
goodbye-msg:
headers:
oneOf:
- $ref: '#/components/schemas/goodbye-headers-1'
- $ref: '#/components/schemas/goodbye-headers-2'
payload:
type: object
properties:
sentAt:
$ref: '#/components/schemas/sent-at'
schemas:
sent-at:
type: string
description: The date and time a message was sent.
format: datetime
hello-headers:
type: object
properties:
x-custom-header:
description: You can put whatever you want here
type: string
Accept:
description: You must specificy accept type for response
type: string
x-request-id:
description: Request id for tracing errors
type: string
goodbye-headers-1:
type: object
properties:
x-first-header:
type: string
x-second-header:
type: string
goodbye-headers-2:
type: object
properties:
x-foo:
type: string
x-bar:
type: string
x-foo-bar:
type: string
securitySchemes:
foo:
type: userPassword
description: This is the Foo scheme with username and password config
oAuth2:
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
2 changes: 1 addition & 1 deletion demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import '@anypoint-web-components/anypoint-styles/typography.js';
import '@advanced-rest-client/oauth-authorization/oauth2-authorization.js';
import '@advanced-rest-client/oauth-authorization/oauth1-authorization.js';
import '@advanced-rest-client/xhr-simple-request/xhr-simple-request.js';
import '@api-components/api-server-selector/api-server-selector.js';
import '../api-endpoint-documentation.js';

class ComponentDemo extends ApiDemoPage {
Expand Down Expand Up @@ -186,6 +185,7 @@ class ComponentDemo extends ApiDemoPage {
['demo-api', 'Demo API'],
['appian-api', 'Applian API'],
['nexmo-sms-api', 'Nexmo SMS API'],
['async-api', 'AsyncAPI'],
].map(([file, label]) => html`
<anypoint-item data-src="${file}-compact.json">${label} - compact model</anypoint-item>
<anypoint-item data-src="${file}.json">${label}</anypoint-item>
Expand Down
2 changes: 1 addition & 1 deletion demo/old.index.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
return;
}
}
const webApi = app.$.helper._computeWebApi(app.amfModel);
const webApi = app.$.helper._computeApi(app.amfModel);
const endpoint = app.$.helper._computeEndpointModel(webApi, eId);
app.endpoint = endpoint;
app.selectedShape = id;
Expand Down
29 changes: 0 additions & 29 deletions karma.sl.config.js

This file was deleted.

Loading