Qore Swagger Module Reference  1.0.2
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 
157 namespace Swagger {
160 const ValidIntFormats = ("int32", "int64");
162 const ValidNumberFormats = ("double", "float");
164 const ValidStringFormats = ("binary", "byte", "date", "date-time", "password");
165 
168  "csv": True,
169  "ssv": True,
170  "tsv": True,
171  "pipes": True,
172 );
173 
176  "multi": True,
177 );
178 
185 
187 const MimeDataTypes = {
188  MimeTypeJson: (
189  "serialize": \make_json(),
190  "serialize_verbose": string (auto val) {return make_json(val, JGF_ADD_FORMATTING);},
191  "deserialize": \parse_json(),
192  "module": "json",
193  ),
194  MimeTypeYamlRpc: (
195  "serialize": \make_yaml(),
196  "serialize_verbose": string (auto val) {return make_yaml(val, BlockStyle);},
197  "deserialize": \parse_yaml(),
198  "module": "yaml",
199  ),
200  // Content-Type: application/x-www-form-urlencoded
202  "serialize": \mime_get_form_urlencoded_string(),
203  "serialize_verbose": \mime_get_form_urlencoded_string(),
204  "deserialize": \mime_parse_form_urlencoded_string(),
205  ),
206  // Content-Type: multipart/form-data (handled manually)
208 };
209 
211 const SerializationModules = map $1.module, MimeDataTypes.iterator(), $1;
212 
215 
217 const ValidSchemes = ("http", "https", "ws", "wss");
218 const ValidSchemesHash = map {$1: True}, ValidSchemes;
219 
221 class ObjectBase {
222 
223 public:
224  public :
226 
231 
232 public:
233 
235  constructor();
236 
237 
239 
242  constructor(hash oh);
243 
244 
246  constructor(ObjectBase other);
247 
248 
250 
253  initialize(hash oh);
254 };
255 
257 class SchemaBase {
258 
259 public:
260  public :
262  *float maximum;
263 
265  *float minimum;
266 
269 
272 
274  *int maxLength;
275 
277  *int minLength;
278 
280  *string pattern;
281 
283  *int maxItems;
284 
286  *int minItems;
287 
289  *bool uniqueItems;
290 
292 
295  hash<string, bool> enum;
296 
298  *float multipleOf;
299 
300 public:
301 
303 
306  constructor(string objType, hash oh);
307 
308 
310  constructor(SchemaBase other);
311 
312 
314 
315 private:
316  auto getExampleValue(string type, *string format);
317 public:
318 
319 
321 
322 private:
323  check(bool serialize, bool request, string type, *string format, *SchemaObject items, string path, string method, string name, reference value);
324 public:
325 
326 
327 
328 private:
329  checkStringIntern(string path, string method, string name, string value);
330 public:
331 
332 
333 
334 private:
335  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, int v, reference<int> value);
336 public:
337 
338 
339  // NOTE: "number" also accepts "float"
340 
341 private:
342  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, number v, reference<number> value);
343 public:
344 
345 
347 
348 private:
349  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, binary v, reference value);
350 public:
351 
352 
354 
355 private:
356  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, string v, reference value);
357 public:
358 
359 
361 
362 private:
363  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, date v, reference value);
364 public:
365 
366 
367 
368 private:
369  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, bool v, reference<bool> value);
370 public:
371 
372 
373 
374 private:
375  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, nothing v, reference<nothing> value);
376 public:
377 
378 
380 
381 private:
382  checkArrayParam(bool serialize, bool request, SchemaObject items, string path, string method, string name, reference<softlist> value);
383 public:
384 
385 
387 
388 private:
389  static throwInvalidType(string name, string actual, string expected);
390 public:
391 
392 };
393 
396 
397 public:
399 
406  static SwaggerSchema fromString(string swaggerSpecification, bool json = True);
407 
409 
417  static SwaggerSchema fromFile(string filepath);
418 
420 
429  static hash parseSchemaContent(string filepath, string str);
430 };
431 
433 class SwaggerSchema : public ObjectBase,public AbstractRestSchemaValidator {
434 
435 public:
436  public :
438 
442  string swaggerSpec;
443 
446 
449 
451 
457  *string host;
458 
460 
465  *string basePath;
466 
468 
473  hash<string, bool> schemes;
474 
476 
480  hash<string, bool> consumes;
481 
483 
487  hash<string, bool> produces;
488 
490 
493  hash<string, SchemaObject> definitions();
494 
496 
499  hash<string, AbstractParameterObject> parameters();
500 
502 
505  hash<string, ResponseObject> responses;
506 
508 
511  hash<string, SecuritySchemeObject> securityDefinitions;
512 
514 
525  hash<string, softlist<string>> security;
526 
528 
537  list<TagObject> tags;
538 
541 
543  const SwaggerOptions = (
544  "compact_serialization": True,
545  "def_path": True,
546  "try_import": True,
547  );
548 
549 public:
550 
551  private :
554 
556  *string def_path;
557 
559  *code try_import;
560 
561 public:
562 
564 
579  constructor(hash oh, *hash opts) ;
580 
581 
583 
585  SchemaObject resolveSchemaObject(string name, string refstr, hash oh);
586 
587 
589 
591  ParameterItemsSchemaObject resolveParameterItemsSchemaObject(string name, string refstr, hash oh);
592 
593 
595 
597  AbstractParameterObject resolveParameter(string name, string refstr, hash oh);
598 
599 
601 
603  ResponseObject resolveResponse(string name, string refstr, hash oh);
604 
605 
607 
612 private:
613  string getTargetUrlImpl();
614 public:
615 
616 
618 
629 private:
630  hash<RestSchemaValidator::RestRequestClientInfo> processRequestImpl(string method, string path, auto body, *hash headers, *softlist<string> content_types);
631 public:
632 
633 
635 
645 private:
646  hash<RestSchemaValidator::RestRequestServerInfo> parseRequestImpl(string method, string path, *data http_body, reference<hash> headers);
647 public:
648 
649 
651 
667 private:
668  hash<HttpResponseInfo> processResponseImpl(string method, string path, int code, auto response_body, *hash headers, *softlist<string> content_types);
669 public:
670 
671 
673 
684 private:
685  hash<RestSchemaValidator::RestResponseClientInfo> parseResponseImpl(string method, string path, int code, *data response_body, hash hdr);
686 public:
687 
688 
690 
693 private:
694  hash<string, list<string>> getPathOperationHashImpl();
695 public:
696 
697 
699 
702 private:
703  string getBasePathImpl();
704 public:
705 
706 
708 
711 private:
712  setBasePathImpl(string basePath);
713 public:
714 
715 
717 
723 private:
724  hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(string method, string path);
725 public:
726 
727 
729 
736 private:
737  hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequestImpl(string method, string path, *softlist<string> content_types);
738 public:
739 
740 
742 
749 private:
750  hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(string method, string path, int code);
751 public:
752 
753 
755 
763 private:
764  hash<RestExampleResponseInfo> getExampleResponseImpl(string method, string path, int code, *softlist<string> content_types);
765 public:
766 
767 
769 
772 private:
773  hash getExternalReference(string refstr);
774 public:
775 
776 
778 
789  private;
790 
791 
793 
809  private;
810 
811 
813 
821  private;
822 
823 
825 
833  private;
834 
835 
837 
844  private;
845 
846 };
847 
849 class InfoObject : public ObjectBase {
850 
851 public:
852  public :
854  string title;
855 
857  *string desc;
858 
860  *string termsOfService;
861 
863  string version;
864 
867 
870 
871 public:
872 
874 
880  constructor(hash oh) ;
881 
882 };
883 
885 class ContactObject : public ObjectBase {
886 
887 public:
888  public :
890  *string name;
891 
893  *string url;
894 
896  *string email;
897 
898 public:
899 
901 
906  constructor(hash oh) ;
907 
908 };
909 
911 class LicenseObject : public ObjectBase {
912 
913 public:
914  public :
916  string name;
917 
919  *string url;
920 
921 public:
922 
924 
930  constructor(hash oh) ;
931 
932 };
933 
935 
942 
943 public:
944  private :
946  string pfx;
947 
949  string name;
950 
953 
956 
958  hash<string, PathComponent> paths;
959 
960 public:
961 
963  constructor(hash oh, string pfx, SwaggerSchema swagger);
964 
965 
967 
968 private:
969  constructor(string full_path, list l, int offset, hash oh);
970 public:
971 
972 
974 
975 private:
976  add(string full_path, list l, int offset, hash oh, SwaggerSchema swagger);
977 public:
978 
979 
981 
983  PathItemObject match(list path);
984 
985 
987 
989  getPathOperationHash(reference<hash<string, list<string>>> h);
990 
991 };
992 
994 class PathsObject : public ObjectBase {
995 
996 public:
997  private :
1000 
1001 public:
1002 
1004 
1012  constructor(hash oh, SwaggerSchema swagger) ;
1013 
1014 
1016 
1018  PathItemObject match(string path);
1019 
1020 
1022 
1024  hash<string, list<string>> getPathOperationHash();
1025 
1026 };
1027 
1029 
1034 class PathItemObject : public ObjectBase {
1035 
1036 public:
1037  public :
1039 
1044  *string ref;
1045 
1047 
1056  hash<string, AbstractParameterObject> parameters();
1057 
1060 
1061 public:
1062 
1063  private :
1065 
1075  hash<string, OperationObject> operations;
1076 
1077 public:
1078 
1080 
1089  constructor(string path, hash oh, SwaggerSchema swagger) ;
1090 
1091 
1093 
1100  OperationObject getOperation(string method, string path);
1101 
1102 
1104 
1106  softlist getMethods();
1107 
1108 };
1109 
1111 class OperationObject : public ObjectBase {
1112 
1113 public:
1114  public :
1116  string path;
1117 
1119  string method;
1120 
1122 
1126 
1128  *string summary;
1129 
1131  *string desc;
1132 
1134 
1138  bool deprec = False;
1139 
1142 
1144 
1150  *string operationId;
1151 
1153 
1158  hash<string, bool> consumes;
1159 
1161 
1166  hash<string, bool> produces;
1167 
1169 
1177  hash<string, AbstractParameterObject> parameters();
1178 
1181 
1184 
1186 
1190  list<string> schemes;
1191 
1193 
1205  list<hash<string, list<string>>> security;
1206 
1207 public:
1208 
1210 
1219  constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
1220 
1221 
1223 
1232  validateRequest(bool serialize, PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers, *reference<hash<string, bool>> mime_types);
1233 
1234 
1236 
1246  parseRequest(PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers);
1247 
1248 
1250  validateResponse(string method, string path, PathItemObject pio, int code, reference<auto> response_body, reference<hash<string, bool>> mime_types);
1251 
1252 
1254 
1261  hash<RestQoreExampleCodeInfo> getQoreExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger);
1262 
1263 
1265 
1273  hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger, reference rbody);
1274 
1275 
1277 
1283  hash<RestQoreExampleCodeInfo> getQoreExampleResponse(string method, string path, int code);
1284 
1285 
1287 
1294  hash<RestExampleResponseInfo> getExampleResponse(string method, string path, int code, reference body);
1295 
1296 
1297 
1298 private:
1299  getQoreExampleParams(reference<hash> query, reference<hash> headers, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1300 public:
1301 
1302 
1304 
1305 private:
1306  doDefaultParams(reference<hash<UriQueryInfo>> h, reference<hash> headers, reference<auto> body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1307 public:
1308 
1309 
1311 
1312 private:
1313  checkMissingParams(hash<UriQueryInfo> h, *hash headers, auto body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1314 public:
1315 
1316 
1318 
1321 private:
1322  *ResponseObject getResponse(int code);
1323 public:
1324 
1325 
1327 
1328 private:
1329  error(string err, string fmt);
1330 public:
1331 
1332 };
1333 
1336 
1337 public:
1338  public :
1340  *string desc;
1341 
1343  string url;
1344 
1345 public:
1346 
1348 
1354  constructor(hash oh) ;
1355 
1356 };
1357 
1359 
1396 
1397 public:
1398  public :
1400 
1407  string name;
1408 
1410 
1414  string inLoc;
1415 
1417  *string desc;
1418 
1420 
1425  bool required = False;
1426 
1427 public:
1428 
1429  private :
1430  const OtherParameterMap = (
1431  "query": True,
1432  "header": True,
1433  "path": True,
1434  "formData": True,
1435  );
1436 
1437 public:
1438 
1440 
1447  constructor(hash oh) ;
1448 
1449 
1451  abstract check(bool serialize, bool request, string path, string method, string name, reference value);
1452 
1454  auto getDefaultValue();
1455 
1456 
1458  static AbstractParameterObject newParameter(string name, hash oh, SwaggerSchema swagger);
1459 };
1460 
1463 
1464 public:
1465  public :
1468 
1469 public:
1470 
1472 
1479  constructor(hash oh, SwaggerSchema swagger) ;
1480 
1481 
1483  check(bool serialize, bool request, string path, string method, string name, reference value);
1484 
1485 
1487  string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv);
1488 
1489 
1490  // returns an example value for a REST API call
1491  auto getExampleValue();
1492 
1493 };
1494 
1497 
1498 public:
1499  public :
1501 
1510  string type;
1511 
1513  *string format;
1514 
1516 
1521  bool allowEmptyValue = False;
1522 
1525 
1527 
1541 
1543 
1551 
1553  const ParameterTypes = SchemaObject::ScalarTypes + (
1554  "file": True,
1555  );
1556 
1557 public:
1558 
1560 
1569  constructor(string name, hash oh, SwaggerSchema swagger) ;
1570 
1571 
1573  check(bool serialize, bool request, string path, string method, string name, reference value);
1574 
1575 
1577  auto getDefaultValue();
1578 
1579 
1581  auto getExampleValue();
1582 
1583 
1585 
1586 private:
1587  static checkValueType(auto value, string type, *SchemaObject items, *string loc);
1588 public:
1589 
1590 };
1591 
1593 class ResponsesObject : public ObjectBase {
1594 
1595 public:
1596  public :
1597  // The documentation of responses other than the ones declared for specific HTTP response codes.
1602 
1603  // A hash mapping HTTP status codes to @ref ResponseObject "ResponseObjects".
1608  hash<string, ResponseObject> responses;
1609 
1610 public:
1611 
1613 
1623  constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
1624 
1625 };
1626 
1628 class ResponseObject : public ObjectBase {
1629 
1630 public:
1631  public :
1633  string desc;
1634 
1636 
1643 
1645 
1649 
1651 
1659 
1660 public:
1661 
1663 
1672 private:
1673  constructor(string key, hash oh, SwaggerSchema swagger) ;
1674 public:
1675 
1676 
1678 
1686  static ResponseObject newResponse(string key, hash oh, SwaggerSchema swagger);
1687 };
1688 
1690 class HeaderObject : public ObjectBase,public SchemaBase {
1691 
1692 public:
1693  public :
1695  *string desc;
1696 
1698 
1702  string type;
1703 
1705  *string format;
1706 
1709 
1711 
1721 
1723 
1730 
1731 public:
1732 
1734 
1742  constructor(hash oh, SwaggerSchema swagger) ;
1743 
1744 
1746 
1747 private:
1748  static checkValueType(auto value, string type, *SchemaObject items, *string loc);
1749 public:
1750 
1751 };
1752 
1754 class TagObject : public ObjectBase {
1755 
1756 public:
1757  public :
1759  string name;
1760 
1762  *string desc;
1763 
1766 
1767 public:
1768 
1770 
1776  constructor(hash oh) ;
1777 
1778 };
1779 
1781 class SchemaObject : public ObjectBase,public SchemaBase {
1782 
1783 public:
1784  public :
1786  string name;
1787 
1789 
1793  string type;
1794 
1796  *string format;
1797 
1799  *string title;
1800 
1802  *string desc;
1803 
1806 
1809 
1812 
1815 
1817 
1821  hash<string, SchemaObject> properties;
1822 
1824 
1829 
1831 
1834  hash<string, bool> required;
1835 
1837 
1855  *string discriminator;
1856 
1858 
1865  bool readOnly = False;
1866 
1868 
1876  list<SchemaObject> allOf();
1877 
1879 
1887 
1890 
1892  auto example;
1893 
1895  const ScalarTypes = (
1896  "string": True,
1897  "number": True,
1898  "integer": True,
1899  "boolean": True,
1900  "array": True,
1901  );
1902 
1904  const ReferenceTypes = ScalarTypes + (
1905  "object": True,
1906  );
1907 
1908 public:
1909 
1911 
1923 private:
1924  constructor(string name, hash oh, SwaggerSchema swagger) ;
1925 public:
1926 
1927 
1929  string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv, string name, bool decl);
1930 
1931 
1932  // returns an example value for a REST API call
1933  auto getExampleValue();
1934 
1935 
1937  check(bool serialize, bool request, string path, string method, string name, reference value);
1938 
1939 
1940 
1941 private:
1942  checkObjectProperty(string name, string prop);
1943 public:
1944 
1945 
1947 
1948 private:
1949  checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, hash v, reference<hash> value);
1950 public:
1951 
1952 
1954 
1955 private:
1956  static checkValueType(auto value, string type, *SchemaObject items, *string loc);
1957 public:
1958 
1959 
1961 
1972  static SchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
1973 
1975 
1977  static SchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger);
1978 };
1979 
1982 
1983 public:
1984  public :
1986 
2000 
2001 public:
2002 
2004 
2017 private:
2018  constructor(string name, hash oh, SwaggerSchema swagger) ;
2019 public:
2020 
2021 
2023 
2035  static ParameterItemsSchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
2036 
2038 
2040  static ParameterItemsSchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger);
2041 };
2042 
2044 
2049 class XmlObject : public ObjectBase {
2050 
2051 public:
2052  public :
2054 
2061  *string name;
2062 
2064  *string ns;
2065 
2067  *string prefix;
2068 
2070  bool attribute = False;
2071 
2073 
2077  bool wrapped = False;
2078 
2079 public:
2080 
2082 
2087  constructor(hash oh) ;
2088 
2089 };
2090 
2092 
2098 
2099 public:
2100  public :
2102  string type;
2103 
2105  *string desc;
2106 
2108 
2111  *string name;
2112 
2114 
2117  *string inLoc;
2118 
2120 
2125  *string flow;
2126 
2128 
2132 
2134 
2137  *string tokenUrl;
2138 
2140 
2148 
2149 public:
2150 
2152 
2161  constructor(hash oh) ;
2162 
2163 };
2164 
2166 class ScopesObject : public ObjectBase {
2167 
2168 public:
2169  public :
2171 
2174  hash<string, string> fields;
2175 
2176 public:
2177 
2179 
2184  constructor(hash oh) ;
2185 
2186 };
2187 
2188 } // end namespace swagger
2189 
2190 // private namespace for internal definitions
2191 namespace Priv {
2192  // a set of string values
2193  const SwaggerListToStringSet = -1;
2194  // a set of any type that can be converted to a string
2195  const SwaggerListToAnySet = -2;
2196  const SwaggerListToHashOfStrings = -3;
2197 
2198  const TypeMap = (
2199  NT_INT: "int",
2200  NT_STRING: "string",
2201  NT_FLOAT: "float",
2202  NT_LIST: "list",
2203  NT_HASH: "hash",
2204  NT_NOTHING: "nothing",
2205  NT_BOOLEAN: "bool",
2206  SwaggerListToStringSet: "list<string>",
2207  SwaggerListToAnySet: "list<auto>",
2208  );
2209 
2211 
2221  required_field(string objType, hash oh, string name, int typeCode, reference<auto> target);
2222 
2223 
2225 
2235  required_field(string objType, hash oh, string name, hash<string, bool> typeCodes, reference<auto> target);
2236 
2237 
2239 
2250  bool optional_field(string objType, hash oh, string name, int typeCode, reference<auto> target);
2251 
2252 
2254 
2265  bool optional_field(string objType, hash oh, string name, hash<string, bool> typeCodes, reference<auto> target);
2266 
2267 
2269  check_type_code(string objType, string name, auto val, int typeCode);
2270 
2271 
2273  get_value(string objType, string name, int typeCode, auto val, reference<auto> target);
2274 
2275 
2277  string get_qore_type(string name, string type, *string format, *SchemaObject items);
2278 
2279 }
hash< string, bool > produces
A set of MIME types (strings) the APIs can produce.
Definition: Swagger.qm.dox.h:487
Describes the operations available on a single path.
Definition: Swagger.qm.dox.h:1034
Base used by OtherParameter, HeaderObject and SchemaObject.
Definition: Swagger.qm.dox.h:257
hash< string, ResponseObject > responses
Definition: Swagger.qm.dox.h:1608
date date(date dt)
ResponseObject defaultResp
Definition: Swagger.qm.dox.h:1601
string pfx
path prefix
Definition: Swagger.qm.dox.h:946
hash< string, bool > consumes
A set of MIME types (strings) the APIs can consume.
Definition: Swagger.qm.dox.h:480
This class stores the path tree for URI path matching.
Definition: Swagger.qm.dox.h:994
*PathItemObject pio
the PathItemObject associated with this path (if any)
Definition: Swagger.qm.dox.h:955
PathsObject paths
Required. The available paths and operations for the API.
Definition: Swagger.qm.dox.h:448
const NT_NOTHING
const ValidStringFormatsHash
A hash of valid string type formats.
Definition: Swagger.qm.dox.h:184
SchemaObject schema
Required. The schema defining the type used for the body parameter.
Definition: Swagger.qm.dox.h:1467
string name
Required. The name of the parameter. Parameter names are case sensitive.
Definition: Swagger.qm.dox.h:1407
Describes a single API operation on a path.
Definition: Swagger.qm.dox.h:1111
*string email
The email address of the contact person/organization. MUST be in the format of an email address...
Definition: Swagger.qm.dox.h:896
*ExternalDocumentationObject externalDocs
Additional external documentation.
Definition: Swagger.qm.dox.h:540
This is the root document object for the API specification. It combines what previously was the Resou...
Definition: Swagger.qm.dox.h:433
*int maxProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.1.
Definition: Swagger.qm.dox.h:1811
string url
Required. The URL for the target documentation. Value MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1343
const ValidNumberFormatsHash
A hash of valid number type formats.
Definition: Swagger.qm.dox.h:182
string title
Required. The title of the application.
Definition: Swagger.qm.dox.h:854
*string prefix
The prefix to be used for the name.
Definition: Swagger.qm.dox.h:2067
*string name
The name of the header or query parameter to be used.
Definition: Swagger.qm.dox.h:2111
hash< string, PathComponent > paths
hash of non-wildcard paths to the next level
Definition: Swagger.qm.dox.h:958
*PathComponent wildcard
if there is a wildcard to a PathComponent
Definition: Swagger.qm.dox.h:952
auto defaultVal
Declares the value of the parameter that the server will use if none is provided. ...
Definition: Swagger.qm.dox.h:1550
string name
Required. The name of the tag.
Definition: Swagger.qm.dox.h:1759
Holds the relative paths to the individual endpoints.
Definition: Swagger.qm.dox.h:941
*ExternalDocumentationObject externalDocs
Additional external documentation for this tag.
Definition: Swagger.qm.dox.h:1765
Allows the definition of a security scheme that can be used by the operations.
Definition: Swagger.qm.dox.h:2097
auto example
A free-form property to include an example of an instance for this schema.
Definition: Swagger.qm.dox.h:1892
*SchemaObject items
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.1.
Definition: Swagger.qm.dox.h:1805
*string name
The identifying name of the contact person/organization.
Definition: Swagger.qm.dox.h:890
main namespace for all public Swagger declarations
Definition: Swagger.qm.dox.h:158
string name
current component name
Definition: Swagger.qm.dox.h:949
defines an object in a schema
Definition: Swagger.qm.dox.h:1781
const MimeDataTypes
supported mime types for de/serializing data
Definition: Swagger.qm.dox.h:187
AbstractParameterObject specialization for "body" parameters.
Definition: Swagger.qm.dox.h:1462
Lists the available scopes for an OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2166
const True
const MimeDataTypes const MimeContentTypes
MIME types for data serialization.
Definition: Swagger.qm.dox.h:214
string method
the HTTP method for the operation
Definition: Swagger.qm.dox.h:1119
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:286
list< string > schemes
The transfer protocol for the operation.
Definition: Swagger.qm.dox.h:1190
*string termsOfService
The Terms of Service for the API.
Definition: Swagger.qm.dox.h:860
list< TagObject > tags
A list of tags used by the specification with additional metadata.
Definition: Swagger.qm.dox.h:537
const NT_FLOAT
A metadata object that allows for more fine-tuned XML model definitions.
Definition: Swagger.qm.dox.h:2049
const MimeTypeMultipartFormData
const ParameterCollectionFormats
valid parameter collection formats
Definition: Swagger.qm.dox.h:175
hash< string, bool > produces
A hash of MIME types (strings) the operation can produce.
Definition: Swagger.qm.dox.h:1166
*string inLoc
The location of the API key. Valid values are "query" or "header".
Definition: Swagger.qm.dox.h:2117
string path
the URI path for the operation
Definition: Swagger.qm.dox.h:1116
number number(softnumber n)
*ExternalDocumentationObject externalDocs
Additional external documentation for this schema.
Definition: Swagger.qm.dox.h:1889
const NT_LIST
binary binary()
const ValidSchemes
Valid transfer protocol schemes.
Definition: Swagger.qm.dox.h:217
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:525
initialize(hash oh)
Initialize.
hash< string, bool > schemes
The transfer protocol of the API.
Definition: Swagger.qm.dox.h:473
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:1834
string name
Required. The license name used for the API.
Definition: Swagger.qm.dox.h:916
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:298
const False
string type
Required. The type of the object.
Definition: Swagger.qm.dox.h:1702
*string host
The host (name or IP) serving the API.
Definition: Swagger.qm.dox.h:457
*string def_path
the default path to use when retrieving external schema references
Definition: Swagger.qm.dox.h:556
list list(...)
auto defaultVal
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.
Definition: Swagger.qm.dox.h:1808
hash< string, bool > consumes
A list of MIME types (strings) the operation can consume.
Definition: Swagger.qm.dox.h:1158
*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:1417
string name
the name of this object for documentation and example purposes
Definition: Swagger.qm.dox.h:1786
string swaggerSpec
Swagger Specification version being used.
Definition: Swagger.qm.dox.h:442
const MimeTypeFormUrlEncoded
*string desc
A short description for security scheme.
Definition: Swagger.qm.dox.h:2105
*ContactObject contact
The contact information for the exposed API.
Definition: Swagger.qm.dox.h:866
AbstractParameterObject body
the body parameter, if defined for this operation
Definition: Swagger.qm.dox.h:1180
Describes a single operation parameter.
Definition: Swagger.qm.dox.h:1395
*int maxItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
Definition: Swagger.qm.dox.h:283
License information for the exposed API.
Definition: Swagger.qm.dox.h:911
const ValidStringFormats
Valid string type formats.
Definition: Swagger.qm.dox.h:164
*bool exclusiveMin
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:271
const MimeTypeYamlRpc
*string desc
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1802
string type
Required. The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Definition: Swagger.qm.dox.h:2102
string version
Required. Provides the version of the application API (not to be confused with the specification vers...
Definition: Swagger.qm.dox.h:863
*ScopesObject scopes
The available scopes for the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2147
*int maxLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
Definition: Swagger.qm.dox.h:274
*string desc
A short description of the target documentation. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1340
string type
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.2.
Definition: Swagger.qm.dox.h:1793
const CollectionFormats
allowed collection formats
Definition: Swagger.qm.dox.h:167
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1513
AbstractParameterObject specialization for parameters other than "body".
Definition: Swagger.qm.dox.h:1496
Base class for the Swagger specification objects, wrapping the vendor extensions. ...
Definition: Swagger.qm.dox.h:221
hash< string, SecuritySchemeObject > securityDefinitions
Security scheme definitions that can be used across the specification.
Definition: Swagger.qm.dox.h:511
PathComponent paths
the tree of path components for path matching with wildcards
Definition: Swagger.qm.dox.h:999
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1796
list tags
A list of tags (strings or TagObjects) for API documentation control.
Definition: Swagger.qm.dox.h:1125
const NT_INT
const NT_BOOLEAN
const ValidNumberFormats
Valid number type formats.
Definition: Swagger.qm.dox.h:162
*ParameterItemsSchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1524
const ScalarTypes
valid scalar types
Definition: Swagger.qm.dox.h:1895
*string name
Replaces the name of the element/attribute used for the described schema property.
Definition: Swagger.qm.dox.h:2061
auto defaultVal
Declares the value of the header that the server will use if none is provided.
Definition: Swagger.qm.dox.h:1729
hash< string, ResponseObject > responses
Response definitions that can be used across operations. This property does not define global respons...
Definition: Swagger.qm.dox.h:505
AbstractParameterObject body
The body parameter, if defined for this path.
Definition: Swagger.qm.dox.h:1059
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:1821
string desc
Required. A short description of the response. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1633
InfoObject info
Required. Provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:445
hash< string, OperationObject > operations
A hash of OperationObjects correspoding to different methods.
Definition: Swagger.qm.dox.h:1075
*string basePath
The base path on which the API is served, which is relative to the host.
Definition: Swagger.qm.dox.h:465
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1720
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:265
*int minProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.2.
Definition: Swagger.qm.dox.h:1814
*bool uniqueItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.
Definition: Swagger.qm.dox.h:289
*string flow
The flow used by the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2125
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1705
Contact information for the exposed API.
Definition: Swagger.qm.dox.h:885
Allows referencing an external resource for extended documentation.
Definition: Swagger.qm.dox.h:1335
*string operationId
Unique string used to identify the operation.
Definition: Swagger.qm.dox.h:1150
*string url
The URL pointing to the contact information. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:893
*string desc
A short description of the header.
Definition: Swagger.qm.dox.h:1695
auto additionalProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:1828
*string url
A URL to the license used for the API. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:919
string string(softstring str, *string enc)
*string ref
Allows for an external definition of this path item.
Definition: Swagger.qm.dox.h:1044
*string ns
The URL of the namespace definition. Value SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2064
*bool exclusiveMax
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:268
*float maximum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:262
Definition: Swagger.qm.dox.h:2191
const ValidIntFormatsHash
A hash of valid integer type formats.
Definition: Swagger.qm.dox.h:180
ResponsesObject responses
Required. The list of possible responses as they are returned from executing this operation...
Definition: Swagger.qm.dox.h:1183
*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:2137
*string desc
A short description of the application. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:857
*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:2131
const NT_HASH
string inLoc
Required. The location of the parameter.
Definition: Swagger.qm.dox.h:1414
const ValidIntFormats
Valid integer type formats.
Definition: Swagger.qm.dox.h:160
bool compact_serialization
if serialized data should be subject to compact serialization (default: True)
Definition: Swagger.qm.dox.h:553
*SchemaObject schema
A definition of the response structure.
Definition: Swagger.qm.dox.h:1642
*string desc
A short description for the tag. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1762
*ExternalDocumentationObject externalDocs
Additional external documentation for this operation.
Definition: Swagger.qm.dox.h:1141
*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:559
list< hash< string, list< string > > > security
A declaration of which security schemes are applied for this operation.
Definition: Swagger.qm.dox.h:1205
items schema object for non-body parameters
Definition: Swagger.qm.dox.h:1981
describes a single HTTP header
Definition: Swagger.qm.dox.h:1690
contains the possible responses for an operation
Definition: Swagger.qm.dox.h:1593
hash vendorExtensions
Allows extensions to the Swagger Schema.
Definition: Swagger.qm.dox.h:230
hash hash(object obj)
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1999
const SerializationModules
modules available for data serialization and/or deserialization
Definition: Swagger.qm.dox.h:211
*string title
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1799
*string pattern
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
Definition: Swagger.qm.dox.h:280
The object provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:849
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1540
hash headers
A hash of headers that are (can be) sent with the response.
Definition: Swagger.qm.dox.h:1648
*SchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1708
Used for loading the Swagger definitions.
Definition: Swagger.qm.dox.h:395
hash examples
A hash of example response messages.
Definition: Swagger.qm.dox.h:1658
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:2174
*string discriminator
Adds support for polymorphism.
Definition: Swagger.qm.dox.h:1855
string type
Required. The type of the parameter.
Definition: Swagger.qm.dox.h:1510
hash< auto > mime_parse_form_urlencoded_string(string str)
Describes a single response from an API Operation.
Definition: Swagger.qm.dox.h:1628
Allows adding metadata to a single tag that is used by the OperationObject. It is not mandatory to ha...
Definition: Swagger.qm.dox.h:1754
*XmlObject xml
This MAY be used only on properties schemas. It has no effect on root schemas.
Definition: Swagger.qm.dox.h:1886
*string desc
A verbose explanation of the operation behavior. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1131
*string summary
A short summary of what the operation does.
Definition: Swagger.qm.dox.h:1128
*LicenseObject license
The license information for the exposed API.
Definition: Swagger.qm.dox.h:869
*int minLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
Definition: Swagger.qm.dox.h:277