Skip to content

Commit

Permalink
tests: added some test files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-bonnel committed Jul 2, 2018
1 parent 6dfb748 commit dc21cec
Show file tree
Hide file tree
Showing 5 changed files with 1,546 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import OpenApi from '../src/OpenApi.vue'
import 'vue-material/dist/vue-material.css'
import VueResource from 'vue-resource'

import jsonApi from './petstore.json'
import jsonApi from './multiple-example-koumoul.json'

Vue.use(VueResource)
Vue.use(VueMaterial)
Expand Down
37 changes: 37 additions & 0 deletions test/cobaRefExternal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"openapi": "3.0.0",
"servers": [
{
"url": "http://api.nyata.com/v1",
"description": "Production server version 1"
},
{
"url": "http://staging-api.example.com",
"description": "Staging server"
}
],
"info": {
"description": "This is a server of Tabloid Nyata.\n",
"version": "0.1.0",
"title": "Tabloid Nyata Advertising",
"termsOfService": "http://www.ooolabs.id/tabloid-nyata-terms/",
"contact": {
"email": "[email protected]"
},
"license": {
"name": "Proprietary license",
"url": "http://www.ooolabs.id/license/"
}
},
"tags": [
{
"name": "membership",
"description": "Everything about user, group, and role"
}
],
"paths": {
"/membership": {
"$ref": "https://gist.githubusercontent.com/3mp3ri0r/307fa6314ad5a9e31a8ac9f04273a272/raw/1c7e1ba47f6a57861a41320a6f2a962352f2ac6a/membershipGetJson.json"
}
}
}
208 changes: 208 additions & 0 deletions test/cowpi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"openapi": "3.0.0",
"info": {
"title": "Co-Operative Work Programmming Interface",
"version": "1.0.0"
},
"servers": [
{
"url": "http://localhost:9000"
}
],
"paths": {
"/tasks": {
"post": {
"summary": "Assign work to be performed",
"requestBody": {
"description": "Description of the work to be performed",
"content": {
"application/json;profile=http://acme.com/schemas/sow": {
"schema": {
"$ref": "#/components/schemas/statementOfWork"
},
"examples": {
"default": {
"$ref": "#/components/examples/statementOfWork"
}
}
}
}
},
"responses": {
"201": {
"description": "New task created successfully.",
"headers": {
"Content-Location": {
"schema": {
"type": "string",
"format": "uri"
}
}
}
}
}
},
"get": {
"summary": "Retreive a list of tasks a service has been asked to perform",
"responses": {
"200": {
"description": "A list of tasks a service has been asked to peform",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/statementOfWork"
}
}
}
}
}
}
},
"/tasks/{id}": {
"get": {
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A document describing a statement of work",
"content": {
"application/json;profile=http://acme.com/schemas/sow": {
"schema": {
"$ref": "#/components/schemas/statementOfWork"
},
"examples": {
"default": {
"$ref": "#/components/schemas/statementOfWork"
}
}
}
}
}
}
}
},
"/capacity": {
"get": {
"responses": {
"200": {
"description": "List of skills and the available capacity",
"content": {
"application/json;profile=https://acme.com/schemas/worklist": {
"schema": {
"$ref": "#/components/schemas/workList"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"statementOfWork": {
"type": "object",
"properties": {
"statementOfWork": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"requiredSkills": {
"type": "array",
"items": {
"type": "string"
}
},
"estimatedWork": {
"$ref": "#/components/schemas/workList"
},
"dueDateTime": {
"type": "string",
"format": "DateTime"
},
"completedWork": {
"$ref": "#/components/schemas/workList"
},
"status": {
"enum": [
"Active",
"Completed",
"Waiting",
"Cancelled"
]
}
},
"required": [
"description"
]
}
}
}
},
"workItem": {
"type": "object",
"properties": {
"skill": {
"type": "string"
},
"minutes": {
"type": "number"
}
}
},
"workList": {
"type": "array",
"items": {
"$ref": "#/components/schemas/workItem"
}
}
},
"examples": {
"statementOfWork": {
"summary": "A description of work that needs to be performed",
"value": {
"description": "Do this stuff for me",
"requiredSkills": [
"dance",
"sing",
"limbo"
],
"estimatedWork": [
{
"skill": "dance",
"minutes": 3
},
{
"skill": "sing",
"minutes": 7
},
{
"skill": "limbo",
"minutes": 1
}
],
"dueDateTime": "2017-10-22 10:45am",
"completedWork": [
{
"skill": "dance",
"minutes": 2
}
],
"status": "Active"
}
}
}
}
}
Loading

0 comments on commit dc21cec

Please sign in to comment.