Skip to content

Commit

Permalink
feat: initialize thirdparty snippets (#15)
Browse files Browse the repository at this point in the history
* feat: initialize thirdparty snippets

* chore: address comments
  • Loading branch information
kleyow authored Aug 14, 2020
1 parent 074caf5 commit 09855eb
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
urls: [
{url: "fspiop-rest-v1.0-openapi3-snippets.yaml", name: "v1.0"},
{url: "fspiop-rest-v1.1-openapi3-snippets.yaml", name: "v1.1"},
{url: "thirdparty-openapi3-snippets.yaml", name: "thirdparty"},
],
dom_id: '#swagger-ui',
deepLinking: true,
Expand Down
37 changes: 37 additions & 0 deletions docs/thirdparty-openapi3-snippets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
openapi: 3.0.2
info:
version: '0.1'
title: Thirdparty Snippets
description: |
Based on sequence diagrams
(https://github.com/mojaloop/pisp/tree/master/docs/out).
This is a work in progress.
license:
name: TBD
servers:
- url: '{protocol}://hostname:<port>/switch/'
variables:
protocol:
enum:
- http
- https
default: https
components:
schemas:
AccountAddress:
type: string
description: |
A long-lived unique account identifier provided by the DFSP. This MUST NOT
be Bank Account Number or anything that may expose a User's private bank
account information.
pattern: '^([0-9A-Za-z_~\-\.]+[0-9A-Za-z_~\-])$'
minLength: 1
maxLength: 1023
paths:
/health:
get:
summary: This path is for demonstration purposes.
description: A valid OpenApi3 specification requires `paths` to be defined.
responses:
'200':
description: OK
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "2.0.0",
"description": "Mojaloop API specification reusable snippets",
"scripts": {
"buildv1.0": "swagger-cli bundle -t yaml -o docs/fspiop-rest-v1.0-openapi3-snippets.yaml v1.0/openapi3/index.yaml && swagger-cli validate docs/fspiop-rest-v1.0-openapi3-snippets.yaml",
"buildv1.1": "swagger-cli bundle -t yaml -o docs/fspiop-rest-v1.1-openapi3-snippets.yaml v1.1/openapi3/index.yaml && swagger-cli validate docs/fspiop-rest-v1.1-openapi3-snippets.yaml",
"build:v1.0": "swagger-cli bundle -t yaml -o docs/fspiop-rest-v1.0-openapi3-snippets.yaml v1.0/openapi3/index.yaml && swagger-cli validate docs/fspiop-rest-v1.0-openapi3-snippets.yaml",
"build:v1.1": "swagger-cli bundle -t yaml -o docs/fspiop-rest-v1.1-openapi3-snippets.yaml v1.1/openapi3/index.yaml && swagger-cli validate docs/fspiop-rest-v1.1-openapi3-snippets.yaml",
"build:thirdparty": "swagger-cli bundle -t yaml -o docs/thirdparty-openapi3-snippets.yaml thirdparty/openapi3/index.yaml && swagger-cli validate docs/thirdparty-openapi3-snippets.yaml",
"audit:resolve": "SHELL=sh resolve-audit --production",
"audit:check": "SHELL=sh check-audit --production"
},
Expand Down
22 changes: 22 additions & 0 deletions thirdparty/openapi3/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
openapi: 3.0.2
info:
$ref: ./info/index.yaml
servers:
- url: '{protocol}://hostname:<port>/switch/'
variables:
protocol:
enum:
- http
- https
default: https
components:
schemas:
$ref: ./schemas/index.yaml
paths:
/health:
get:
summary: This path is for demonstration purposes.
description: A valid OpenApi3 specification requires `paths` to be defined.
responses:
'200':
description: OK
8 changes: 8 additions & 0 deletions thirdparty/openapi3/info/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '0.1'
title: 'Thirdparty Snippets'
description: |
Based on sequence diagrams
(https://github.com/mojaloop/pisp/tree/master/docs/out).
This is a work in progress.
license:
name: TBD
8 changes: 8 additions & 0 deletions thirdparty/openapi3/schemas/AccountAddress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: string
description: |
A long-lived unique account identifier provided by the DFSP. This MUST NOT
be Bank Account Number or anything that may expose a User's private bank
account information.
pattern: ^([0-9A-Za-z_~\-\.]+[0-9A-Za-z_~\-])$
minLength: 1
maxLength: 1023
2 changes: 2 additions & 0 deletions thirdparty/openapi3/schemas/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
AccountAddress:
$ref: ./AccountAddress.yaml

0 comments on commit 09855eb

Please sign in to comment.