Skip to content

Commit 7f1e300

Browse files
committed
Merge branch 'development'
2 parents 8cde277 + 2163515 commit 7f1e300

File tree

5 files changed

+55
-48
lines changed

5 files changed

+55
-48
lines changed

.module.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
project.name=swagger-sdk
2-
project.version=1.0.3
2+
project.version=1.0.4
33
module.name=swagger-sdk

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ CHANGELOG
99

1010
## 1.0.2
1111
* Adobe Coldfusion compatibility updates
12+
13+
14+
## 1.0.4
15+
* Adds security definitions to default template

instructions.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

modules/swagger-sdk/models/OpenAPI/Util.cfc

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,25 @@ component name="OpenAPIUtil" accessors="true" {
1414
//We need to use Linked Hashmaps to maintain struct order for serialization and deserialization
1515
var template = createLinkedHashMap();
1616

17-
var templateDefaults = [
18-
{"swagger" : "2.0"},
19-
{
20-
"info" : {
21-
"version" : "",
22-
"title" : "",
23-
"description" : "",
24-
"termsOfService": "",
25-
"contact" : createLinkedHashMap(),
26-
"license" : createLinkedHashMap()
27-
}
28-
},
29-
{"host" : ""},
30-
{"basePath" : ""},
31-
{"schemes" : []},
32-
{"consumes" : ["application/json","multipart/form-data","application/x-www-form-urlencoded"]},
33-
{"produces" : ["application/json"]},
34-
{"paths" : createLinkedHashMap()}
17+
var templateDefaults = [
18+
{"swagger" : "2.0"},
19+
{
20+
"info" : {
21+
"version" : "",
22+
"title" : "",
23+
"description" : "",
24+
"termsOfService": "",
25+
"contact" : createLinkedHashMap(),
26+
"license" : createLinkedHashMap()
27+
}
28+
},
29+
{"host" : ""},
30+
{"basePath" : ""},
31+
{"schemes" : []},
32+
{"consumes" : ["application/json","multipart/form-data","application/x-www-form-urlencoded"]},
33+
{"produces" : ["application/json"]},
34+
{"paths" : createLinkedHashMap()},
35+
{"securityDefinitions": createLinkedHashMap()}
3536

3637
];
3738

readme.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,37 @@
33

44
This module allows for software development using the Swagger/OpenAPI specification and utilizes the [v3.0 OpenAPI Specification]([https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md])
55

6+
##See These Other Swagger/OpenAPI-aware Coldbox Modules
7+
8+
* [Relax](https://www.forgebox.io/view/relax)
9+
* [cbSwagger](https://www.forgebox.io/view/cbswagger)
10+
11+
12+
##Install Swaggger SDK ( via Commandbox )
13+
14+
`box install swagger-sdk`
15+
16+
##Usage
17+
18+
This SDK allows for creation, parsing, and normalization of OpenAPI documentation.
19+
20+
###Parse a Swagger JSON or YML file:
21+
22+
```
23+
var APIDoc = Wirebox.getInstance( "OpenAPIParser@SwaggerSDK" ).init( DocumentPathOrURL );
24+
```
25+
26+
This returns the parsed document object, which can be fully normalized ( e.g. $ref attributes are loaded and normalized within the document ) with `APIDoc.getNormalizedDocument()`
27+
28+
You may also export the normalized document object to JSON (`APIDoc.asJSON()`), YAML (`APIDoc.asYAML()`), or as Struct++ (`APIDoc.asYAML()`)
29+
30+
++Note: in order to maintain order, the struct format used is a Java.util.LinkedHashmap. In order to access struct keys you will need to use braces ( e.g. = `APIDoc[ "info" ][ "title" ]` )
31+
32+
33+
See the APIDocs for additional information on methods and functions available in the SDK
34+
35+
36+
637
##LICENSE
738
Apache License, Version 2.0.
839

0 commit comments

Comments
 (0)