-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Swagger2Markup/swagger2markup-cli#17 * Swagger2Markup/swagger2markup-cli#17 add test case
- Loading branch information
Showing
8 changed files
with
327 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/test/resources/expected/asciidoc/empty_tables/definitions.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
[[_definitions]] | ||
== Definitions | ||
|
||
[[_category]] | ||
=== Category | ||
[%hardbreaks] | ||
__Polymorphism__ : Composition | ||
|
||
|
||
[options="header", cols=".^3a,.^4a"] | ||
|=== | ||
|Name|Schema | ||
|**id** + | ||
__optional__|integer (int64) | ||
|=== | ||
|
||
|
||
[[_identified]] | ||
=== Identified | ||
|
||
[options="header", cols=".^3a,.^4a"] | ||
|=== | ||
|Name|Schema | ||
|**id** + | ||
__optional__|integer (int64) | ||
|=== | ||
|
||
|
||
[[_user]] | ||
=== User | ||
[%hardbreaks] | ||
__Polymorphism__ : Composition | ||
|
||
|
||
[options="header", cols=".^3a,.^4a"] | ||
|=== | ||
|Name|Schema | ||
|**id** + | ||
__optional__|integer (int64) | ||
|=== | ||
|
||
|
||
|
42 changes: 42 additions & 0 deletions
42
src/test/resources/expected/asciidoc/empty_tables/overview.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
= Swagger Petstore API | ||
|
||
|
||
[[_overview]] | ||
== Overview | ||
This is a sample server Petstore server. | ||
|
||
http://swagger.wordnik.com[Learn about Swagger] or join the IRC channel `#swagger` on irc.freenode.net. | ||
|
||
For this sample, you can use the api key `special-key` to test the authorization filters | ||
|
||
|
||
=== Version information | ||
[%hardbreaks] | ||
__Version__ : 1.0.0 | ||
|
||
|
||
=== Contact information | ||
[%hardbreaks] | ||
__Contact__ : [email protected] | ||
|
||
|
||
=== License information | ||
[%hardbreaks] | ||
__License__ : Apache 2.0 | ||
__License URL__ : http://www.apache.org/licenses/LICENSE-2.0.html | ||
__Terms of service__ : http://helloreverb.com/terms/ | ||
|
||
|
||
=== URI scheme | ||
[%hardbreaks] | ||
__Host__ : petstore.swagger.wordnik.com | ||
__BasePath__ : /v2 | ||
__Schemes__ : HTTP | ||
|
||
|
||
=== Tags | ||
|
||
* user : User resource | ||
|
||
|
||
|
48 changes: 48 additions & 0 deletions
48
src/test/resources/expected/asciidoc/empty_tables/paths.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
[[_paths]] | ||
== Paths | ||
|
||
<<< | ||
|
||
[[_createuser]] | ||
=== Create user | ||
.... | ||
POST /users | ||
.... | ||
|
||
|
||
==== Description | ||
This can only be done by the logged in user. | ||
|
||
|
||
==== Parameters | ||
|
||
[options="header", cols=".^2a,.^3a,.^9a,.^4a"] | ||
|=== | ||
|Type|Name|Description|Schema | ||
|**Body**|**body** + | ||
__optional__|Created user object|<<_user,User>> | ||
|=== | ||
|
||
|
||
==== Responses | ||
|
||
[options="header", cols=".^2a,.^14a,.^4a"] | ||
|=== | ||
|HTTP Code|Description|Schema | ||
|**default**|successful operation|No Content | ||
|=== | ||
|
||
|
||
==== Produces | ||
|
||
* `application/json` | ||
* `application/xml` | ||
|
||
|
||
==== Tags | ||
|
||
* user | ||
|
||
|
||
|
21 changes: 21 additions & 0 deletions
21
src/test/resources/expected/asciidoc/empty_tables/security.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
[[_securityscheme]] | ||
== Security | ||
|
||
[[_api_key]] | ||
=== api_key | ||
[%hardbreaks] | ||
__Type__ : apiKey | ||
__Name__ : api_key | ||
__In__ : HEADER | ||
|
||
|
||
[[_petstore_auth]] | ||
=== petstore_auth | ||
[%hardbreaks] | ||
__Type__ : oauth2 | ||
__Flow__ : implicit | ||
__Token URL__ : http://petstore.swagger.wordnik.com/api/oauth/dialog | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"description": "This is a sample server Petstore server.\n\n[Learn about Swagger](http://swagger.wordnik.com) or join the IRC channel `#swagger` on irc.freenode.net.\n\nFor this sample, you can use the api key `special-key` to test the authorization filters\n", | ||
"version": "1.0.0", | ||
"title": "Swagger Petstore API", | ||
"termsOfService": "http://helloreverb.com/terms/", | ||
"contact": { | ||
"name": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0", | ||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html" | ||
} | ||
}, | ||
"host": "petstore.swagger.wordnik.com", | ||
"basePath": "/v2", | ||
"schemes": [ | ||
"http" | ||
], | ||
"tags": [ | ||
{ | ||
"name": "user", | ||
"description": "User resource" | ||
} | ||
], | ||
"paths": { | ||
"/users": { | ||
"post": { | ||
"tags": [ | ||
"user" | ||
], | ||
"summary": "Create user", | ||
"description": "This can only be done by the logged in user.", | ||
"operationId": "createUser", | ||
"produces": [ | ||
"application/json", | ||
"application/xml" | ||
], | ||
"parameters": [ | ||
{ | ||
"in": "body", | ||
"name": "body", | ||
"description": "Created user object", | ||
"required": false, | ||
"schema": { | ||
"$ref": "#/definitions/User" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"default": { | ||
"description": "successful operation" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"securityDefinitions": { | ||
"api_key": { | ||
"type": "apiKey", | ||
"name": "api_key", | ||
"in": "header" | ||
}, | ||
"petstore_auth": { | ||
"type": "oauth2", | ||
"authorizationUrl": "http://petstore.swagger.wordnik.com/api/oauth/dialog", | ||
"flow": "implicit", | ||
"scopes": { | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"FoundPets": { | ||
"description": "successful operation", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Pet" | ||
} | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"petId": { | ||
"in": "path", | ||
"name": "petId", | ||
"description": "ID of the pet", | ||
"required": true, | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
}, | ||
"definitions": { | ||
"Identified": { | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
} | ||
}, | ||
"User": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Identified" | ||
}, | ||
{ | ||
"properties": { | ||
} | ||
} | ||
] | ||
}, | ||
"Category": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/Identified" | ||
} | ||
] | ||
} | ||
} | ||
} |