You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LICENSE.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Copyright 2018 Mathew Polzin
1
+
Copyright 2020 Mathew Polzin
2
2
3
3
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -101,10 +101,10 @@ The types used by this library largely mirror the object definitions found in th
101
101
At the root there is an `OpenAPI.Document`. In addition to some information that applies to the entire API, the document contains `OpenAPI.Components` (essentially a dictionary of reusable components that can be referenced with `JSONReferences`) and an `OpenAPI.PathItem.Map` (a dictionary of routes your API defines).
102
102
103
103
#### Routes
104
-
Each route is an entry in the document's `OpenAPI.PathItem.Map`. The keys of this dictionary are the paths for each route (i.e. `/widgets`). The values of this dictionary are `OpenAPI.PathItems` which define any combination of endpoints (i.e. `GET`, `POST`, `PATCH`, etc.) that the given route supports.
104
+
Each route is an entry in the document's `OpenAPI.PathItem.Map`. The keys of this dictionary are the paths for each route (i.e. `/widgets`). The values of this dictionary are `OpenAPI.PathItems` which define any combination of endpoints (i.e. `GET`, `POST`, `PATCH`, etc.) that the given route supports. In addition to accessing endpoints on a path item under the name of the method (`.get`, `.post`, etc.), you can get an array of pairs matching endpoint methods to operations with the `.endpoints` method on `PathItem`.
105
105
106
106
#### Endpoints
107
-
Each endpoint on a route is defined by an `OpenAPI.PathItem.Operation`. Among other things, this operation can specify the parameters (path, query, header, etc.), request body, and response bodies/codes supported by the given endpoint.
107
+
Each endpoint on a route is defined by an `OpenAPI.Operation`. Among other things, this operation can specify the parameters (path, query, header, etc.), request body, and response bodies/codes supported by the given endpoint.
108
108
109
109
#### Request/Response Bodies
110
110
Request and response bodies can be defined in great detail using OpenAPI's derivative of the JSON Schema specification. This library uses the `JSONSchema` type for such schema definitions.
@@ -183,7 +183,7 @@ For example,
183
183
let apiDoc: OpenAPI.Document =...
184
184
let addBooksPath = apiDoc.paths["/cloudloading/addBook"]
185
185
186
-
let addBooksParameters: [OpenAPI.PathItem.Parameter]?= addBooksPath?.parameters.compactMap(apiDoc.components.dereference)
186
+
let addBooksParameters: [OpenAPI.Parameter]?= addBooksPath?.parameters.compactMap(apiDoc.components.dereference)
187
187
```
188
188
189
189
## Notes
@@ -275,7 +275,7 @@ See [**A note on dictionary ordering**](#a-note-on-dictionary-ordering) before d
internalfunc validate(securityRequirements:[OpenAPI.SecurityRequirement], at path:OpenAPI.Path, for verb:OpenAPI.HttpVerb, against components:OpenAPI.Components)throws{
302
+
internalfunc validate(securityRequirements:[OpenAPI.SecurityRequirement], at path:OpenAPI.Path, for verb:OpenAPI.HttpMethod, against components:OpenAPI.Components)throws{
0 commit comments