Qore Swagger Module Reference  1.0.1
Swagger.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* Swagger.qm Copyright (C) 2017 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 
26 // make sure we have the required qore version
27 
28 // try importing JSON and YAML modules
29 
30 
31 
32 // need mime definitions
33 // requires the Util module
34 // requires the HttpServerUtil module
35 // requires the RestSchemaValidator module
36 
37 
153 namespace Swagger {
156 const ValidIntFormats = ("int32", "int64");
158 const ValidNumberFormats = ("double", "float");
160 const ValidStringFormats = ("binary", "byte", "date", "date-time", "password");
161 
164  "csv": True,
165  "ssv": True,
166  "tsv": True,
167  "pipes": True,
168 );
169 
172  "multi": True,
173 );
174 
181 
183 const MimeDataTypes = {
184  MimeTypeJson: (
185  "serialize": \make_json(),
186  "serialize_verbose": string (auto val) {return make_json(val, JGF_ADD_FORMATTING);},
187  "deserialize": \parse_json(),
188  "module": "json",
189  ),
190  MimeTypeYamlRpc: (
191  "serialize": \make_yaml(),
192  "serialize_verbose": string (auto val) {return make_yaml(val, BlockStyle);},
193  "deserialize": \parse_yaml(),
194  "module": "yaml",
195  ),
196  // Content-Type: application/x-www-form-urlencoded
198  "serialize": \mime_get_form_urlencoded_string(),
199  "serialize_verbose": \mime_get_form_urlencoded_string(),
200  "deserialize": \mime_parse_form_urlencoded_string(),
201  ),
202  // Content-Type: multipart/form-data (handled manually)
204 };
205 
207 const SerializationModules = map $1.module, MimeDataTypes.iterator(), $1;
208 
211 
213 const ValidSchemes = ("http", "https", "ws", "wss");
214 const ValidSchemesHash = map {$1: True}, ValidSchemes;
215 
217 class ObjectBase {
218 
219 public:
220  public :
222 
227 
228 public:
229 
231  constructor();
232 
233 
235 
238  constructor(hash oh);
239 
240 
242  constructor(ObjectBase other);
243 
244 
246 
249  initialize(hash oh);
250 };
251 
253 class SchemaBase {
254 
255 public:
256  public :
258  *float maximum;
259 
261  *float minimum;
262 
265 
268 
270  *int maxLength;
271 
273  *int minLength;
274 
276  *string pattern;
277 
279  *int maxItems;
280 
282  *int minItems;
283 
285  *bool uniqueItems;
286 
288 
291  hash<string, bool> enum;
292 
294  *float multipleOf;
295 
296 public:
297 
299 
302  constructor(string objType, hash oh);
303 
304 
306  constructor(SchemaBase other);
307 
308 
310 
311 private:
312  auto getExampleValue(string type, *string format);
313 public:
314 
315 
317 
318 private:
319  check(bool serialize, bool request, string type, *string format, *SchemaObject items, string path, string method, string name, reference value);
320 public:
321 
322 
323 
324 private:
325  checkStringIntern(string path, string method, string name, string value);
326 public:
327 
328 
329 
330 private:
331  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, int v, reference<int> value);
332 public:
333 
334 
335  // NOTE: "number" also accepts "float"
336 
337 private:
338  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, number v, reference<number> value);
339 public:
340 
341 
343 
344 private:
345  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, binary v, reference value);
346 public:
347 
348 
350 
351 private:
352  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, string v, reference value);
353 public:
354 
355 
357 
358 private:
359  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, date v, reference value);
360 public:
361 
362 
363 
364 private:
365  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, bool v, reference<bool> value);
366 public:
367 
368 
369 
370 private:
371  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, nothing v, reference<nothing> value);
372 public:
373 
374 
376 
377 private:
378  checkArrayParam(bool serialize, bool request, SchemaObject items, string path, string method, string name, reference<softlist> value);
379 public:
380 
381 
383 
384 private:
385  static throwInvalidType(string name, string actual, string expected);
386 public:
387 
388 };
389 
392 
393 public:
395 
402  static SwaggerSchema fromString(string swaggerSpecification, bool json = True);
403 
405 
413  static SwaggerSchema fromFile(string filepath);
414 
416 
425  static hash parseSchemaContent(string filepath, string str);
426 };
427 
429 class SwaggerSchema : public ObjectBase,public AbstractRestSchemaValidator {
430 
431 public:
432  public :
434 
438  string swaggerSpec;
439 
442 
445 
447 
453  *string host;
454 
456 
461  *string basePath;
462 
464 
469  hash<string, bool> schemes;
470 
472 
476  hash<string, bool> consumes;
477 
479 
483  hash<string, bool> produces;
484 
486 
489  hash<string, SchemaObject> definitions();
490 
492 
495  hash<string, AbstractParameterObject> parameters();
496 
498 
501  hash<string, ResponseObject> responses;
502 
504 
507  hash<string, SecuritySchemeObject> securityDefinitions;
508 
510 
521  hash<string, softlist<string>> security;
522 
524 
533  list<TagObject> tags;
534 
537 
539  const SwaggerOptions = (
540  "compact_serialization": True,
541  "def_path": True,
542  "try_import": True,
543  );
544 
545 public:
546 
547  private :
550 
552  *string def_path;
553 
555  *code try_import;
556 
557 public:
558 
560 
575  constructor(hash oh, *hash opts) ;
576 
577 
579 
581  SchemaObject resolveSchemaObject(string name, string refstr, hash oh);
582 
583 
585 
587  ParameterItemsSchemaObject resolveParameterItemsSchemaObject(string name, string refstr, hash oh);
588 
589 
591 
593  AbstractParameterObject resolveParameter(string name, string refstr, hash oh);
594 
595 
597 
599  ResponseObject resolveResponse(string name, string refstr, hash oh);
600 
601 
603 
608 private:
609  string getTargetUrlImpl();
610 public:
611 
612 
614 
625 private:
626  hash<RestSchemaValidator::RestRequestClientInfo> processRequestImpl(string method, string path, auto body, *hash headers, *softlist<string> content_types);
627 public:
628 
629 
631 
641 private:
642  hash<RestSchemaValidator::RestRequestServerInfo> parseRequestImpl(string method, string path, *data http_body, reference<hash> headers);
643 public:
644 
645 
647 
663 private:
664  hash<HttpResponseInfo> processResponseImpl(string method, string path, int code, auto response_body, *hash headers, *softlist<string> content_types);
665 public:
666 
667 
669 
680 private:
681  hash<RestSchemaValidator::RestResponseClientInfo> parseResponseImpl(string method, string path, int code, *data response_body, hash hdr);
682 public:
683 
684 
686 
689 private:
690  hash<string, list<string>> getPathOperationHashImpl();
691 public:
692 
693 
695 
698 private:
699  string getBasePathImpl();
700 public:
701 
702 
704 
707 private:
708  setBasePathImpl(string basePath);
709 public:
710 
711 
713 
719 private:
720  hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(string method, string path);
721 public:
722 
723 
725 
732 private:
733  hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequestImpl(string method, string path, *softlist<string> content_types);
734 public:
735 
736 
738 
745 private:
746  hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(string method, string path, int code);
747 public:
748 
749 
751 
759 private:
760  hash<RestExampleResponseInfo> getExampleResponseImpl(string method, string path, int code, *softlist<string> content_types);
761 public:
762 
763 
765 
768 private:
769  hash getExternalReference(string refstr);
770 public:
771 
772 
774 
785  private;
786 
787 
789 
805  private;
806 
807 
809 
817  private;
818 
819 
821 
829  private;
830 
831 };
832 
834 class InfoObject : public ObjectBase {
835 
836 public:
837  public :
839  string title;
840 
842  *string desc;
843 
845  *string termsOfService;
846 
848  string version;
849 
852 
855 
856 public:
857 
859 
865  constructor(hash oh) ;
866 
867 };
868 
870 class ContactObject : public ObjectBase {
871 
872 public:
873  public :
875  *string name;
876 
878  *string url;
879 
881  *string email;
882 
883 public:
884 
886 
891  constructor(hash oh) ;
892 
893 };
894 
896 class LicenseObject : public ObjectBase {
897 
898 public:
899  public :
901  string name;
902 
904  *string url;
905 
906 public:
907 
909 
915  constructor(hash oh) ;
916 
917 };
918 
920 
927 
928 public:
929  private :
931  string pfx;
932 
934  string name;
935 
938 
941 
943  hash<string, PathComponent> paths;
944 
945 public:
946 
948  constructor(hash oh, string pfx, SwaggerSchema swagger);
949 
950 
952 
953 private:
954  constructor(string full_path, list l, int offset, hash oh);
955 public:
956 
957 
959 
960 private:
961  add(string full_path, list l, int offset, hash oh, SwaggerSchema swagger);
962 public:
963 
964 
966 
968  PathItemObject match(list path);
969 
970 
972 
974  getPathOperationHash(reference<hash<string, list<string>>> h);
975 
976 };
977 
979 class PathsObject : public ObjectBase {
980 
981 public:
982  private :
985 
986 public:
987 
989 
997  constructor(hash oh, SwaggerSchema swagger) ;
998 
999 
1001 
1003  PathItemObject match(string path);
1004 
1005 
1007 
1009  hash<string, list<string>> getPathOperationHash();
1010 
1011 };
1012 
1014 
1019 class PathItemObject : public ObjectBase {
1020 
1021 public:
1022  public :
1024 
1029  *string ref;
1030 
1032 
1041  hash<string, AbstractParameterObject> parameters();
1042 
1045 
1046 public:
1047 
1048  private :
1050 
1060  hash<string, OperationObject> operations;
1061 
1062 public:
1063 
1065 
1074  constructor(string path, hash oh, SwaggerSchema swagger) ;
1075 
1076 
1078 
1085  OperationObject getOperation(string method, string path);
1086 
1087 
1089 
1091  softlist getMethods();
1092 
1093 };
1094 
1096 class OperationObject : public ObjectBase {
1097 
1098 public:
1099  public :
1101  string path;
1102 
1104  string method;
1105 
1107 
1111 
1113  *string summary;
1114 
1116  *string desc;
1117 
1119 
1123  bool deprec = False;
1124 
1127 
1129 
1135  *string operationId;
1136 
1138 
1143  hash<string, bool> consumes;
1144 
1146 
1151  hash<string, bool> produces;
1152 
1154 
1162  hash<string, AbstractParameterObject> parameters();
1163 
1166 
1169 
1171 
1175  list<string> schemes;
1176 
1178 
1190  list<hash<string, list<string>>> security;
1191 
1192 public:
1193 
1195 
1204  constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
1205 
1206 
1208 
1217  validateRequest(bool serialize, PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers, *reference<hash<string, bool>> mime_types);
1218 
1219 
1221 
1231  parseRequest(PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers);
1232 
1233 
1235  validateResponse(string method, string path, PathItemObject pio, int code, reference<auto> response_body, reference<hash<string, bool>> mime_types);
1236 
1237 
1239 
1246  hash<RestQoreExampleCodeInfo> getQoreExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger);
1247 
1248 
1250 
1258  hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger, reference rbody);
1259 
1260 
1262 
1268  hash<RestQoreExampleCodeInfo> getQoreExampleResponse(string method, string path, int code);
1269 
1270 
1272 
1279  hash<RestExampleResponseInfo> getExampleResponse(string method, string path, int code, reference body);
1280 
1281 
1282 
1283 private:
1284  getQoreExampleParams(reference<hash> query, reference<hash> headers, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1285 public:
1286 
1287 
1289 
1290 private:
1291  doDefaultParams(reference<hash<UriQueryInfo>> h, reference<hash> headers, reference<auto> body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1292 public:
1293 
1294 
1296 
1297 private:
1298  checkMissingParams(hash<UriQueryInfo> h, *hash headers, auto body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1299 public:
1300 
1301 
1303 
1306 private:
1307  *ResponseObject getResponse(int code);
1308 public:
1309 
1310 
1312 
1313 private:
1314  error(string err, string fmt);
1315 public:
1316 
1317 };
1318 
1321 
1322 public:
1323  public :
1325  *string desc;
1326 
1328  string url;
1329 
1330 public:
1331 
1333 
1339  constructor(hash oh) ;
1340 
1341 };
1342 
1344 
1381 
1382 public:
1383  public :
1385 
1392  string name;
1393 
1395 
1399  string inLoc;
1400 
1402  *string desc;
1403 
1405 
1410  bool required = False;
1411 
1412 public:
1413 
1414  private :
1415  const OtherParameterMap = (
1416  "query": True,
1417  "header": True,
1418  "path": True,
1419  "formData": True,
1420  );
1421 
1422 public:
1423 
1425 
1432  constructor(hash oh) ;
1433 
1434 
1436  abstract check(bool serialize, bool request, string path, string method, string name, reference value);
1437 
1439  auto getDefaultValue();
1440 
1441 
1443  static AbstractParameterObject newParameter(string name, hash oh, SwaggerSchema swagger);
1444 };
1445 
1448 
1449 public:
1450  public :
1453 
1454 public:
1455 
1457 
1464  constructor(hash oh, SwaggerSchema swagger) ;
1465 
1466 
1468  check(bool serialize, bool request, string path, string method, string name, reference value);
1469 
1470 
1472  string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv);
1473 
1474 
1475  // returns an example value for a REST API call
1476  auto getExampleValue();
1477 
1478 };
1479 
1482 
1483 public:
1484  public :
1486 
1495  string type;
1496 
1498  *string format;
1499 
1501 
1506  bool allowEmptyValue = False;
1507 
1510 
1512 
1526 
1528 
1536 
1538  const ParameterTypes = SchemaObject::ScalarTypes + (
1539  "file": True,
1540  );
1541 
1542 public:
1543 
1545 
1554  constructor(string name, hash oh, SwaggerSchema swagger) ;
1555 
1556 
1558  check(bool serialize, bool request, string path, string method, string name, reference value);
1559 
1560 
1562  auto getDefaultValue();
1563 
1564 
1566  auto getExampleValue();
1567 
1568 
1570 
1571 private:
1572  static checkValueType(auto value, string type, *SchemaObject items, *string loc);
1573 public:
1574 
1575 };
1576 
1578 class ResponsesObject : public ObjectBase {
1579 
1580 public:
1581  public :
1582  // The documentation of responses other than the ones declared for specific HTTP response codes.
1587 
1588  // A hash mapping HTTP status codes to @ref ResponseObject "ResponseObjects".
1593  hash<string, ResponseObject> responses;
1594 
1595 public:
1596 
1598 
1608  constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
1609 
1610 };
1611 
1613 class ResponseObject : public ObjectBase {
1614 
1615 public:
1616  public :
1618  string desc;
1619 
1621 
1628 
1630 
1634 
1636 
1644 
1645 public:
1646 
1648 
1657 private:
1658  constructor(string key, hash oh, SwaggerSchema swagger) ;
1659 public:
1660 
1661 
1663 
1671  static ResponseObject newResponse(string key, hash oh, SwaggerSchema swagger);
1672 };
1673 
1675 class HeaderObject : public ObjectBase,public SchemaBase {
1676 
1677 public:
1678  public :
1680  *string desc;
1681 
1683 
1687  string type;
1688 
1690  *string format;
1691 
1694 
1696 
1706 
1708 
1715 
1716 public:
1717 
1719 
1727  constructor(hash oh, SwaggerSchema swagger) ;
1728 
1729 
1731 
1732 private:
1733  static checkValueType(auto value, string type, *SchemaObject items, *string loc);
1734 public:
1735 
1736 };
1737 
1739 class TagObject : public ObjectBase {
1740 
1741 public:
1742  public :
1744  string name;
1745 
1747  *string desc;
1748 
1751 
1752 public:
1753 
1755 
1761  constructor(hash oh) ;
1762 
1763 };
1764 
1766 class SchemaObject : public ObjectBase,public SchemaBase {
1767 
1768 public:
1769  public :
1771  string name;
1772 
1774 
1778  string type;
1779 
1781  *string format;
1782 
1784  *string title;
1785 
1787  *string desc;
1788 
1791 
1794 
1797 
1800 
1802 
1806  hash<string, SchemaObject> properties;
1807 
1809 
1814 
1816 
1819  hash<string, bool> required;
1820 
1822 
1840  *string discriminator;
1841 
1843 
1850  bool readOnly = False;
1851 
1853 
1861  list<SchemaObject> allOf();
1862 
1864 
1872 
1875 
1877  auto example;
1878 
1880  const ScalarTypes = (
1881  "string": True,
1882  "number": True,
1883  "integer": True,
1884  "boolean": True,
1885  "array": True,
1886  );
1887 
1889  const ReferenceTypes = ScalarTypes + (
1890  "object": True,
1891  );
1892 
1893 public:
1894 
1896 
1908 private:
1909  constructor(string name, hash oh, SwaggerSchema swagger) ;
1910 public:
1911 
1912 
1914  string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv, string name, bool decl);
1915 
1916 
1917  // returns an example value for a REST API call
1918  auto getExampleValue();
1919 
1920 
1922  check(bool serialize, bool request, string path, string method, string name, reference value);
1923 
1924 
1925 
1926 private:
1927  checkObjectProperty(string name, string prop);
1928 public:
1929 
1930 
1932 
1933 private:
1934  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, hash v, reference<hash> value);
1935 public:
1936 
1937 
1939 
1940 private:
1941  static checkValueType(auto value, string type, *SchemaObject items, *string loc);
1942 public:
1943 
1944 
1946 
1957  static SchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
1958 
1960 
1962  static SchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger);
1963 };
1964 
1967 
1968 public:
1969  public :
1971 
1985 
1986 public:
1987 
1989 
2002 private:
2003  constructor(string name, hash oh, SwaggerSchema swagger) ;
2004 public:
2005 
2006 
2008 
2020  static ParameterItemsSchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
2021 
2023 
2025  static ParameterItemsSchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger);
2026 };
2027 
2029 
2034 class XmlObject : public ObjectBase {
2035 
2036 public:
2037  public :
2039 
2046  *string name;
2047 
2049  *string ns;
2050 
2052  *string prefix;
2053 
2055  bool attribute = False;
2056 
2058 
2062  bool wrapped = False;
2063 
2064 public:
2065 
2067 
2072  constructor(hash oh) ;
2073 
2074 };
2075 
2077 
2083 
2084 public:
2085  public :
2087  string type;
2088 
2090  *string desc;
2091 
2093 
2096  *string name;
2097 
2099 
2102  *string inLoc;
2103 
2105 
2110  *string flow;
2111 
2113 
2117 
2119 
2122  *string tokenUrl;
2123 
2125 
2133 
2134 public:
2135 
2137 
2146  constructor(hash oh) ;
2147 
2148 };
2149 
2151 class ScopesObject : public ObjectBase {
2152 
2153 public:
2154  public :
2156 
2159  hash<string, string> fields;
2160 
2161 public:
2162 
2164 
2169  constructor(hash oh) ;
2170 
2171 };
2172 
2173 } // end namespace swagger
2174 
2175 // private namespace for internal definitions
2176 namespace Priv {
2177  // a set of string values
2178  const SwaggerListToStringSet = -1;
2179  // a set of any type that can be converted to a string
2180  const SwaggerListToAnySet = -2;
2181  const SwaggerListToHashOfStrings = -3;
2182 
2183  const TypeMap = (
2184  NT_INT: "int",
2185  NT_STRING: "string",
2186  NT_FLOAT: "float",
2187  NT_LIST: "list",
2188  NT_HASH: "hash",
2189  NT_NOTHING: "nothing",
2190  NT_BOOLEAN: "bool",
2191  SwaggerListToStringSet: "list<string>",
2192  SwaggerListToAnySet: "list<auto>",
2193  );
2194 
2196 
2206  required_field(string objType, hash oh, string name, int typeCode, reference<auto> target);
2207 
2208 
2210 
2220  required_field(string objType, hash oh, string name, hash<string, bool> typeCodes, reference<auto> target);
2221 
2222 
2224 
2235  bool optional_field(string objType, hash oh, string name, int typeCode, reference<auto> target);
2236 
2237 
2239 
2250  bool optional_field(string objType, hash oh, string name, hash<string, bool> typeCodes, reference<auto> target);
2251 
2252 
2254  check_type_code(string objType, string name, auto val, int typeCode);
2255 
2256 
2258  get_value(string objType, string name, int typeCode, auto val, reference<auto> target);
2259 
2260 
2262  string get_qore_type(string name, string type, *string format, *SchemaObject items);
2263 
2264 }
hash< string, bool > produces
A set of MIME types (strings) the APIs can produce.
Definition: Swagger.qm.dox.h:483
Describes the operations available on a single path.
Definition: Swagger.qm.dox.h:1019
Base used by OtherParameter, HeaderObject and SchemaObject.
Definition: Swagger.qm.dox.h:253
hash< string, ResponseObject > responses
Definition: Swagger.qm.dox.h:1593
date date(date dt)
ResponseObject defaultResp
Definition: Swagger.qm.dox.h:1586
string pfx
path prefix
Definition: Swagger.qm.dox.h:931
hash< string, bool > consumes
A set of MIME types (strings) the APIs can consume.
Definition: Swagger.qm.dox.h:476
This class stores the path tree for URI path matching.
Definition: Swagger.qm.dox.h:979
*PathItemObject pio
the PathItemObject associated with this path (if any)
Definition: Swagger.qm.dox.h:940
PathsObject paths
Required. The available paths and operations for the API.
Definition: Swagger.qm.dox.h:444
const NT_NOTHING
const ValidStringFormatsHash
A hash of valid string type formats.
Definition: Swagger.qm.dox.h:180
SchemaObject schema
Required. The schema defining the type used for the body parameter.
Definition: Swagger.qm.dox.h:1452
string name
Required. The name of the parameter. Parameter names are case sensitive.
Definition: Swagger.qm.dox.h:1392
Describes a single API operation on a path.
Definition: Swagger.qm.dox.h:1096
*string email
The email address of the contact person/organization. MUST be in the format of an email address...
Definition: Swagger.qm.dox.h:881
*ExternalDocumentationObject externalDocs
Additional external documentation.
Definition: Swagger.qm.dox.h:536
This is the root document object for the API specification. It combines what previously was the Resou...
Definition: Swagger.qm.dox.h:429
*int maxProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.1.
Definition: Swagger.qm.dox.h:1796
string url
Required. The URL for the target documentation. Value MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1328
const ValidNumberFormatsHash
A hash of valid number type formats.
Definition: Swagger.qm.dox.h:178
string title
Required. The title of the application.
Definition: Swagger.qm.dox.h:839
*string prefix
The prefix to be used for the name.
Definition: Swagger.qm.dox.h:2052
*string name
The name of the header or query parameter to be used.
Definition: Swagger.qm.dox.h:2096
hash< string, PathComponent > paths
hash of non-wildcard paths to the next level
Definition: Swagger.qm.dox.h:943
*PathComponent wildcard
if there is a wildcard to a PathComponent
Definition: Swagger.qm.dox.h:937
auto defaultVal
Declares the value of the parameter that the server will use if none is provided. ...
Definition: Swagger.qm.dox.h:1535
string name
Required. The name of the tag.
Definition: Swagger.qm.dox.h:1744
Holds the relative paths to the individual endpoints.
Definition: Swagger.qm.dox.h:926
*ExternalDocumentationObject externalDocs
Additional external documentation for this tag.
Definition: Swagger.qm.dox.h:1750
Allows the definition of a security scheme that can be used by the operations.
Definition: Swagger.qm.dox.h:2082
auto example
A free-form property to include an example of an instance for this schema.
Definition: Swagger.qm.dox.h:1877
*SchemaObject items
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.1.
Definition: Swagger.qm.dox.h:1790
*string name
The identifying name of the contact person/organization.
Definition: Swagger.qm.dox.h:875
main namespace for all public Swagger declarations
Definition: Swagger.qm.dox.h:154
string name
current component name
Definition: Swagger.qm.dox.h:934
defines an object in a schema
Definition: Swagger.qm.dox.h:1766
const MimeDataTypes
supported mime types for de/serializing data
Definition: Swagger.qm.dox.h:183
AbstractParameterObject specialization for "body" parameters.
Definition: Swagger.qm.dox.h:1447
Lists the available scopes for an OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2151
const True
const MimeDataTypes const MimeContentTypes
MIME types for data serialization.
Definition: Swagger.qm.dox.h:210
string method
the HTTP method for the operation
Definition: Swagger.qm.dox.h:1104
string mime_get_form_urlencoded_string(hash h)
*int minItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.
Definition: Swagger.qm.dox.h:282
list< string > schemes
The transfer protocol for the operation.
Definition: Swagger.qm.dox.h:1175
*string termsOfService
The Terms of Service for the API.
Definition: Swagger.qm.dox.h:845
list< TagObject > tags
A list of tags used by the specification with additional metadata.
Definition: Swagger.qm.dox.h:533
const NT_FLOAT
A metadata object that allows for more fine-tuned XML model definitions.
Definition: Swagger.qm.dox.h:2034
const MimeTypeMultipartFormData
const ParameterCollectionFormats
valid parameter collection formats
Definition: Swagger.qm.dox.h:171
hash< string, bool > produces
A hash of MIME types (strings) the operation can produce.
Definition: Swagger.qm.dox.h:1151
*string inLoc
The location of the API key. Valid values are "query" or "header".
Definition: Swagger.qm.dox.h:2102
string path
the URI path for the operation
Definition: Swagger.qm.dox.h:1101
number number(softnumber n)
*ExternalDocumentationObject externalDocs
Additional external documentation for this schema.
Definition: Swagger.qm.dox.h:1874
const NT_LIST
binary binary()
const ValidSchemes
Valid transfer protocol schemes.
Definition: Swagger.qm.dox.h:213
const MimeTypeJson
const NT_STRING
hash< string, softlist< string > > security
A declaration of which security schemes are applied for the API as a whole.
Definition: Swagger.qm.dox.h:521
initialize(hash oh)
Initialize.
hash< string, bool > schemes
The transfer protocol of the API.
Definition: Swagger.qm.dox.h:469
hash< string, bool > required
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.3.
Definition: Swagger.qm.dox.h:1819
string name
Required. The license name used for the API.
Definition: Swagger.qm.dox.h:901
constructor()
Constructor.
*float multipleOf
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.
Definition: Swagger.qm.dox.h:294
const False
string type
Required. The type of the object.
Definition: Swagger.qm.dox.h:1687
*string host
The host (name or IP) serving the API.
Definition: Swagger.qm.dox.h:453
*string def_path
the default path to use when retrieving external schema references
Definition: Swagger.qm.dox.h:552
list list(...)
auto defaultVal
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.
Definition: Swagger.qm.dox.h:1793
hash< string, bool > consumes
A list of MIME types (strings) the operation can consume.
Definition: Swagger.qm.dox.h:1143
*string desc
A brief description of the parameter. This could contain examples of use. GFM syntax can be used for ...
Definition: Swagger.qm.dox.h:1402
string name
the name of this object for documentation and example purposes
Definition: Swagger.qm.dox.h:1771
string swaggerSpec
Swagger Specification version being used.
Definition: Swagger.qm.dox.h:438
const MimeTypeFormUrlEncoded
*string desc
A short description for security scheme.
Definition: Swagger.qm.dox.h:2090
*ContactObject contact
The contact information for the exposed API.
Definition: Swagger.qm.dox.h:851
AbstractParameterObject body
the body parameter, if defined for this operation
Definition: Swagger.qm.dox.h:1165
hash mime_parse_form_urlencoded_string(string str)
Describes a single operation parameter.
Definition: Swagger.qm.dox.h:1380
*int maxItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
Definition: Swagger.qm.dox.h:279
License information for the exposed API.
Definition: Swagger.qm.dox.h:896
const ValidStringFormats
Valid string type formats.
Definition: Swagger.qm.dox.h:160
*bool exclusiveMin
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:267
const MimeTypeYamlRpc
*string desc
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1787
string type
Required. The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Definition: Swagger.qm.dox.h:2087
string version
Required. Provides the version of the application API (not to be confused with the specification vers...
Definition: Swagger.qm.dox.h:848
*ScopesObject scopes
The available scopes for the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2132
*int maxLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
Definition: Swagger.qm.dox.h:270
*string desc
A short description of the target documentation. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1325
string type
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.2.
Definition: Swagger.qm.dox.h:1778
const CollectionFormats
allowed collection formats
Definition: Swagger.qm.dox.h:163
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1498
AbstractParameterObject specialization for parameters other than "body".
Definition: Swagger.qm.dox.h:1481
Base class for the Swagger specification objects, wrapping the vendor extensions. ...
Definition: Swagger.qm.dox.h:217
hash< string, SecuritySchemeObject > securityDefinitions
Security scheme definitions that can be used across the specification.
Definition: Swagger.qm.dox.h:507
PathComponent paths
the tree of path components for path matching with wildcards
Definition: Swagger.qm.dox.h:984
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1781
list tags
A list of tags (strings or TagObjects) for API documentation control.
Definition: Swagger.qm.dox.h:1110
const NT_INT
const NT_BOOLEAN
const ValidNumberFormats
Valid number type formats.
Definition: Swagger.qm.dox.h:158
*ParameterItemsSchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1509
const ScalarTypes
valid scalar types
Definition: Swagger.qm.dox.h:1880
*string name
Replaces the name of the element/attribute used for the described schema property.
Definition: Swagger.qm.dox.h:2046
auto defaultVal
Declares the value of the header that the server will use if none is provided.
Definition: Swagger.qm.dox.h:1714
hash< string, ResponseObject > responses
Response definitions that can be used across operations. This property does not define global respons...
Definition: Swagger.qm.dox.h:501
AbstractParameterObject body
The body parameter, if defined for this path.
Definition: Swagger.qm.dox.h:1044
hash< string, SchemaObject > properties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:1806
string desc
Required. A short description of the response. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1618
InfoObject info
Required. Provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:441
hash< string, OperationObject > operations
A hash of OperationObjects correspoding to different methods.
Definition: Swagger.qm.dox.h:1060
*string basePath
The base path on which the API is served, which is relative to the host.
Definition: Swagger.qm.dox.h:461
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1705
string type(auto arg)
*float minimum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:261
*int minProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.2.
Definition: Swagger.qm.dox.h:1799
*bool uniqueItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.
Definition: Swagger.qm.dox.h:285
*string flow
The flow used by the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2110
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1690
Contact information for the exposed API.
Definition: Swagger.qm.dox.h:870
Allows referencing an external resource for extended documentation.
Definition: Swagger.qm.dox.h:1320
*string operationId
Unique string used to identify the operation.
Definition: Swagger.qm.dox.h:1135
*string url
The URL pointing to the contact information. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:878
*string desc
A short description of the header.
Definition: Swagger.qm.dox.h:1680
auto additionalProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:1813
*string url
A URL to the license used for the API. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:904
string string(softstring str, *string enc)
*string ref
Allows for an external definition of this path item.
Definition: Swagger.qm.dox.h:1029
*string ns
The URL of the namespace definition. Value SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2049
*bool exclusiveMax
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:264
*float maximum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:258
Definition: Swagger.qm.dox.h:2176
const ValidIntFormatsHash
A hash of valid integer type formats.
Definition: Swagger.qm.dox.h:176
ResponsesObject responses
Required. The list of possible responses as they are returned from executing this operation...
Definition: Swagger.qm.dox.h:1168
*string tokenUrl
The token URL to be used for this flow. This SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2122
*string desc
A short description of the application. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:842
*string authorizationUrl
The authorization URL to be used for this flow. This SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2116
const NT_HASH
string inLoc
Required. The location of the parameter.
Definition: Swagger.qm.dox.h:1399
const ValidIntFormats
Valid integer type formats.
Definition: Swagger.qm.dox.h:156
bool compact_serialization
if serialized data should be subject to compact serialization (default: True)
Definition: Swagger.qm.dox.h:549
*SchemaObject schema
A definition of the response structure.
Definition: Swagger.qm.dox.h:1627
*string desc
A short description for the tag. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1747
*ExternalDocumentationObject externalDocs
Additional external documentation for this operation.
Definition: Swagger.qm.dox.h:1126
*code try_import
a call reference or closure to be passed a string name for external schema references, must take a string argument (the resource name) and return a string (the resource data)
Definition: Swagger.qm.dox.h:555
list< hash< string, list< string > > > security
A declaration of which security schemes are applied for this operation.
Definition: Swagger.qm.dox.h:1190
items schema object for non-body parameters
Definition: Swagger.qm.dox.h:1966
describes a single HTTP header
Definition: Swagger.qm.dox.h:1675
contains the possible responses for an operation
Definition: Swagger.qm.dox.h:1578
hash vendorExtensions
Allows extensions to the Swagger Schema.
Definition: Swagger.qm.dox.h:226
hash hash(object obj)
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1984
const SerializationModules
modules available for data serialization and/or deserialization
Definition: Swagger.qm.dox.h:207
*string title
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1784
*string pattern
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
Definition: Swagger.qm.dox.h:276
The object provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:834
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1525
hash headers
A hash of headers that are (can be) sent with the response.
Definition: Swagger.qm.dox.h:1633
*SchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1693
Used for loading the Swagger definitions.
Definition: Swagger.qm.dox.h:391
hash examples
A hash of example response messages.
Definition: Swagger.qm.dox.h:1643
hash< string, string > fields
Maps between a name of a scope to a short description of it (as the value of the property).
Definition: Swagger.qm.dox.h:2159
*string discriminator
Adds support for polymorphism.
Definition: Swagger.qm.dox.h:1840
string type
Required. The type of the parameter.
Definition: Swagger.qm.dox.h:1495
Describes a single response from an API Operation.
Definition: Swagger.qm.dox.h:1613
Allows adding metadata to a single tag that is used by the OperationObject. It is not mandatory to ha...
Definition: Swagger.qm.dox.h:1739
*XmlObject xml
This MAY be used only on properties schemas. It has no effect on root schemas.
Definition: Swagger.qm.dox.h:1871
*string desc
A verbose explanation of the operation behavior. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1116
*string summary
A short summary of what the operation does.
Definition: Swagger.qm.dox.h:1113
*LicenseObject license
The license information for the exposed API.
Definition: Swagger.qm.dox.h:854
*int minLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
Definition: Swagger.qm.dox.h:273