Qore Swagger Module Reference  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 
135 namespace Swagger {
138 const ValidIntFormats = ("int32", "int64");
140 const ValidNumberFormats = ("double", "float");
142 const ValidStringFormats = ("binary", "byte", "date", "date-time", "password");
143 
146  "csv": True,
147  "ssv": True,
148  "tsv": True,
149  "pipes": True,
150 );
151 
154  "multi": True,
155 );
156 
163 
165 const MimeDataTypes = {
166  MimeTypeJson: (
167  "serialize": \make_json(),
168  "serialize_verbose": string (any val) {return make_json(val, JGF_ADD_FORMATTING);},
169  "deserialize": \parse_json(),
170  "module": "json",
171  ),
172  MimeTypeYamlRpc: (
173  "serialize": \make_yaml(),
174  "serialize_verbose": string (any val) {return make_yaml(val, BlockStyle);},
175  "deserialize": \parse_yaml(),
176  "module": "yaml",
177  ),
178  // Content-Type: application/x-www-form-urlencoded
180  "serialize": \mime_get_form_urlencoded_string(),
181  "serialize_verbose": \mime_get_form_urlencoded_string(),
182  "deserialize": \mime_parse_form_urlencoded_string(),
183  ),
184  // Content-Type: multipart/form-data (handled manually)
186 };
187 
189 const SerializationModules = map $1.module, MimeDataTypes.iterator(), $1;
190 
193 
195 const ValidSchemes = ("http", "https", "ws", "wss");
196 const ValidSchemesHash = map {$1: True}, ValidSchemes;
197 
199 class ObjectBase {
200 
201 public:
202  public :
204 
209 
210 public:
211 
213  constructor();
214 
215 
217 
220  constructor(hash oh);
221 
222 
224  constructor(ObjectBase other);
225 
226 
228 
231  initialize(hash oh);
232 };
233 
235 class SchemaBase {
236 
237 public:
238  public :
240  *float maximum;
241 
243  *float minimum;
244 
247 
250 
252  *int maxLength;
253 
255  *int minLength;
256 
258  *string pattern;
259 
261  *int maxItems;
262 
264  *int minItems;
265 
267  *bool uniqueItems;
268 
270 
273  hash<string, bool> enum;
274 
276  *float multipleOf;
277 
278 public:
279 
281 
284  constructor(string objType, hash oh);
285 
286 
288  constructor(SchemaBase other);
289 
290 
292 
293 private:
294  any getExampleValue(string type, *string format);
295 public:
296 
297 
299 
300 private:
301  check(bool serialize, bool request, string type, *SchemaObject items, string path, string method, string name, reference value);
302 public:
303 
304 
306 
307 private:
308  checkIntern(bool serialize, bool request, string type, string path, string method, string name, string v, reference<string> value);
309 public:
310 
311 
312 
313 private:
314  checkStringIntern(string path, string method, string name, data value);
315 public:
316 
317 
318 
319 private:
320  checkIntern(bool serialize, bool request, string type, string path, string method, string name, int v, reference<int> value);
321 public:
322 
323 
324  // NOTE: "number" also accepts "float"
325 
326 private:
327  checkIntern(bool serialize, bool request, string type, string path, string method, string name, number v, reference<number> value);
328 public:
329 
330 
331 
332 private:
333  checkIntern(bool serialize, bool request, string type, string path, string method, string name, bool v, reference<bool> value);
334 public:
335 
336 
337 
338 private:
339  checkIntern(bool serialize, bool request, string type, string path, string method, string name, nothing v, reference<nothing> value);
340 public:
341 
342 
344 
345 private:
346  checkArrayParam(bool serialize, bool request, SchemaObject items, string path, string method, string name, reference<softlist> value);
347 public:
348 
349 
351 
352 private:
353  static throwInvalidType(string name, string actual, string expected);
354 public:
355 
356 };
357 
360 
361 public:
363 
370  static SwaggerSchema fromString(string swaggerSpecification, bool json = True);
371 
373 
381  static SwaggerSchema fromFile(string filepath);
382 
384 
393  static hash parseSchemaContent(string filepath, string str);
394 };
395 
397 class SwaggerSchema : public ObjectBase,public AbstractRestSchemaValidator {
398 
399 public:
400  public :
402 
406  string swaggerSpec;
407 
410 
413 
415 
421  *string host;
422 
424 
429  *string basePath;
430 
432 
437  hash<string, bool> schemes;
438 
440 
444  hash<string, bool> consumes;
445 
447 
451  hash<string, bool> produces;
452 
454 
457  hash<string, SchemaObject> definitions();
458 
460 
463  hash<string, AbstractParameterObject> parameters();
464 
466 
469  hash<string, ResponseObject> responses;
470 
472 
475  hash<string, SecuritySchemeObject> securityDefinitions;
476 
478 
489  hash<string, softlist<string>> security;
490 
492 
501  list<TagObject> tags;
502 
505 
507  const SwaggerOptions = (
508  "compact_serialization": True,
509  "def_path": True,
510  "try_import": True,
511  );
512 
513 public:
514 
515  private :
518 
520  *string def_path;
521 
523  *code try_import;
524 
525 public:
526 
528 
543  constructor(hash oh, *hash opts) ;
544 
545 
547 
549  SchemaObject resolveSchemaObject(string name, string refstr, hash oh);
550 
551 
553 
555  ParameterItemsSchemaObject resolveParameterItemsSchemaObject(string name, string refstr, hash oh);
556 
557 
559 
561  AbstractParameterObject resolveParameter(string name, string refstr, hash oh);
562 
563 
565 
567  ResponseObject resolveResponse(string name, string refstr, hash oh);
568 
569 
571 
576 private:
577  string getTargetUrlImpl();
578 public:
579 
580 
582 
593 private:
594  hash<RestSchemaValidator::RestRequestClientInfo> processRequestImpl(string method, string path, any body, *hash headers, *softlist<string> content_types);
595 public:
596 
597 
599 
609 private:
610  hash<RestSchemaValidator::RestRequestServerInfo> parseRequestImpl(string method, string path, *data http_body, reference<hash> headers);
611 public:
612 
613 
615 
631 private:
632  hash<HttpResponseInfo> processResponseImpl(string method, string path, int code, any response_body, *hash headers, *softlist<string> content_types);
633 public:
634 
635 
637 
648 private:
649  hash<RestSchemaValidator::RestResponseClientInfo> parseResponseImpl(string method, string path, int code, *data response_body, hash hdr);
650 public:
651 
652 
654 
657 private:
658  hash<string, list<string>> getPathOperationHashImpl();
659 public:
660 
661 
663 
666 private:
667  string getBasePathImpl();
668 public:
669 
670 
672 
675 private:
676  setBasePathImpl(string basePath);
677 public:
678 
679 
681 
687 private:
688  hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(string method, string path);
689 public:
690 
691 
693 
700 private:
701  hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequestImpl(string method, string path, *softlist<string> content_types);
702 public:
703 
704 
706 
713 private:
714  hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(string method, string path, int code);
715 public:
716 
717 
719 
727 private:
728  hash<RestExampleResponseInfo> getExampleResponseImpl(string method, string path, int code, *softlist<string> content_types);
729 public:
730 
731 
733 
736 private:
737  hash getExternalReference(string refstr);
738 public:
739 
740 
742 
753  private;
754 
755 
757 
773  private;
774 
775 };
776 
778 class InfoObject : public ObjectBase {
779 
780 public:
781  public :
783  string title;
784 
786  *string desc;
787 
789  *string termsOfService;
790 
792  string version;
793 
796 
799 
800 public:
801 
803 
809  constructor(hash oh) ;
810 
811 };
812 
814 class ContactObject : public ObjectBase {
815 
816 public:
817  public :
819  *string name;
820 
822  *string url;
823 
825  *string email;
826 
827 public:
828 
830 
835  constructor(hash oh) ;
836 
837 };
838 
840 class LicenseObject : public ObjectBase {
841 
842 public:
843  public :
845  string name;
846 
848  *string url;
849 
850 public:
851 
853 
859  constructor(hash oh) ;
860 
861 };
862 
864 
871 
872 public:
873  private :
875  string pfx;
876 
878  string name;
879 
882 
885 
887  hash<string, PathComponent> paths;
888 
889 public:
890 
892  constructor(hash oh, string pfx, SwaggerSchema swagger);
893 
894 
896 
897 private:
898  constructor(string full_path, list l, int offset, hash oh);
899 public:
900 
901 
903 
904 private:
905  add(string full_path, list l, int offset, hash oh, SwaggerSchema swagger);
906 public:
907 
908 
910 
912  PathItemObject match(list path);
913 
914 
916 
918  getPathOperationHash(reference<hash<string, list<string>>> h);
919 
920 };
921 
923 class PathsObject : public ObjectBase {
924 
925 public:
926  private :
929 
930 public:
931 
933 
941  constructor(hash oh, SwaggerSchema swagger) ;
942 
943 
945 
947  PathItemObject match(string path);
948 
949 
951 
953  hash<string, list<string>> getPathOperationHash();
954 
955 };
956 
958 
963 class PathItemObject : public ObjectBase {
964 
965 public:
966  public :
968 
973  *string ref;
974 
976 
985  hash<string, AbstractParameterObject> parameters();
986 
989 
990 public:
991 
992  private :
994 
1004  hash<string, OperationObject> operations;
1005 
1006 public:
1007 
1009 
1018  constructor(string path, hash oh, SwaggerSchema swagger) ;
1019 
1020 
1022 
1029  OperationObject getOperation(string method, string path);
1030 
1031 
1033 
1035  softlist getMethods();
1036 
1037 };
1038 
1040 class OperationObject : public ObjectBase {
1041 
1042 public:
1043  public :
1045  string path;
1046 
1048  string method;
1049 
1051 
1055 
1057  *string summary;
1058 
1060  *string desc;
1061 
1063 
1067  bool deprec = False;
1068 
1071 
1073 
1079  *string operationId;
1080 
1082 
1087  hash<string, bool> consumes;
1088 
1090 
1095  hash<string, bool> produces;
1096 
1098 
1106  hash<string, AbstractParameterObject> parameters();
1107 
1110 
1113 
1115 
1119  list<string> schemes;
1120 
1122 
1134  list<hash<string, list<string>>> security;
1135 
1136 public:
1137 
1139 
1148  constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
1149 
1150 
1152 
1163  validateRequest(bool serialize, PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<hash> body, reference<hash> headers, *reference<hash<string, bool>> mime_types);
1164 
1165 
1167 
1176  parseRequest(PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<hash> body, reference<hash> headers);
1177 
1178 
1180  validateResponse(string method, string path, PathItemObject pio, int code, any response_body, reference<hash<string, bool>> mime_types);
1181 
1182 
1184 
1191  hash<RestQoreExampleCodeInfo> getQoreExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger);
1192 
1193 
1195 
1203  hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger, reference rbody);
1204 
1205 
1207 
1213  hash<RestQoreExampleCodeInfo> getQoreExampleResponse(string method, string path, int code);
1214 
1215 
1217 
1224  hash<RestExampleResponseInfo> getExampleResponse(string method, string path, int code, reference body);
1225 
1226 
1227 
1228 private:
1229  getQoreExampleParams(reference<hash> query, reference<hash> headers, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1230 public:
1231 
1232 
1234 
1235 private:
1236  doDefaultParams(reference<hash<UriQueryInfo>> h, reference<hash> headers, reference<hash> body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1237 public:
1238 
1239 
1241 
1242 private:
1243  checkMissingParams(hash<UriQueryInfo> h, *hash headers, *hash body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1244 public:
1245 
1246 
1248 
1251 private:
1252  *ResponseObject getResponse(int code);
1253 public:
1254 
1255 
1257 
1258 private:
1259  error(string err, string fmt);
1260 public:
1261 
1262 };
1263 
1266 
1267 public:
1268  public :
1270  *string desc;
1271 
1273  string url;
1274 
1275 public:
1276 
1278 
1284  constructor(hash oh) ;
1285 
1286 };
1287 
1289 
1326 
1327 public:
1328  public :
1330 
1337  string name;
1338 
1340 
1344  string inLoc;
1345 
1347  *string desc;
1348 
1350 
1355  bool required = False;
1356 
1357 public:
1358 
1359  private :
1360  const OtherParameterMap = (
1361  "query": True,
1362  "header": True,
1363  "path": True,
1364  "formData": True,
1365  );
1366 
1367 public:
1368 
1370 
1377  constructor(hash oh) ;
1378 
1379 
1381  abstract check(bool serialize, bool request, string path, string method, string name, reference value);
1382 
1384  any getDefaultValue();
1385 
1386 
1388  static AbstractParameterObject newParameter(string name, hash oh, SwaggerSchema swagger);
1389 };
1390 
1393 
1394 public:
1395  public :
1398 
1399 public:
1400 
1402 
1409  constructor(hash oh, SwaggerSchema swagger) ;
1410 
1411 
1413  check(bool serialize, bool request, string path, string method, string name, reference value);
1414 
1415 
1417  string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv);
1418 
1419 
1420  // returns an example value for a REST API call
1421  any getExampleValue();
1422 
1423 };
1424 
1427 
1428 public:
1429  public :
1431 
1440  string type;
1441 
1443  *string format;
1444 
1446 
1451  bool allowEmptyValue = False;
1452 
1455 
1457 
1471 
1473 
1481 
1483  const ParameterTypes = SchemaObject::ScalarTypes + (
1484  "file": True,
1485  );
1486 
1487 public:
1488 
1490 
1499  constructor(string name, hash oh, SwaggerSchema swagger) ;
1500 
1501 
1503  check(bool serialize, bool request, string path, string method, string name, reference value);
1504 
1505 
1507  any getDefaultValue();
1508 
1509 
1511  any getExampleValue();
1512 
1513 
1515 
1516 private:
1517  checkIntern(bool serialize, bool request, string type, string path, string method, string name, string v, reference value);
1518 public:
1519 
1520 
1522 
1523 private:
1524  checkIntern(bool serialize, bool request, string type, string path, string method, string name, binary v, reference value);
1525 public:
1526 
1527 
1529 
1530 private:
1531  checkIntern(bool serialize, bool request, string type, string path, string method, string name, date v, reference value);
1532 public:
1533 
1534 
1536 
1537 private:
1538  static checkValueType(any value, string type, *SchemaObject items, *string loc);
1539 public:
1540 
1541 };
1542 
1544 class ResponsesObject : public ObjectBase {
1545 
1546 public:
1547  public :
1548  // The documentation of responses other than the ones declared for specific HTTP response codes.
1553 
1554  // A hash mapping HTTP status codes to @ref ResponseObject "ResponseObjects".
1559  hash<string, ResponseObject> responses;
1560 
1561 public:
1562 
1564 
1574  constructor(string path, string method, hash oh, SwaggerSchema swagger) ;
1575 
1576 };
1577 
1579 class ResponseObject : public ObjectBase {
1580 
1581 public:
1582  public :
1584  string desc;
1585 
1587 
1594 
1596 
1600 
1602 
1610 
1611 public:
1612 
1614 
1623 private:
1624  constructor(string key, hash oh, SwaggerSchema swagger) ;
1625 public:
1626 
1627 
1629 
1637  static ResponseObject newResponse(string key, hash oh, SwaggerSchema swagger);
1638 };
1639 
1641 class HeaderObject : public ObjectBase,public SchemaBase {
1642 
1643 public:
1644  public :
1646  *string desc;
1647 
1649 
1653  string type;
1654 
1656  *string format;
1657 
1660 
1662 
1672 
1674 
1681 
1682 public:
1683 
1685 
1693  constructor(hash oh, SwaggerSchema swagger) ;
1694 
1695 
1697 
1698 private:
1699  static checkValueType(any value, string type, *SchemaObject items, *string loc);
1700 public:
1701 
1702 };
1703 
1705 class TagObject : public ObjectBase {
1706 
1707 public:
1708  public :
1710  string name;
1711 
1713  *string desc;
1714 
1717 
1718 public:
1719 
1721 
1727  constructor(hash oh) ;
1728 
1729 };
1730 
1732 class SchemaObject : public ObjectBase,public SchemaBase {
1733 
1734 public:
1735  public :
1737  string name;
1738 
1740 
1744  string type;
1745 
1747  *string format;
1748 
1750  *string title;
1751 
1753  *string desc;
1754 
1757 
1760 
1763 
1766 
1768 
1772  hash<string, SchemaObject> properties;
1773 
1775 
1780 
1782 
1785  hash<string, bool> required;
1786 
1788 
1806  *string discriminator;
1807 
1809 
1816  bool readOnly = False;
1817 
1819 
1827  list<SchemaObject> allOf();
1828 
1830 
1838 
1841 
1843  any example;
1844 
1846  const ScalarTypes = (
1847  "string": True,
1848  "number": True,
1849  "integer": True,
1850  "boolean": True,
1851  "array": True,
1852  );
1853 
1855  const ReferenceTypes = ScalarTypes + (
1856  "object": True,
1857  );
1858 
1859 public:
1860 
1862 
1874 private:
1875  constructor(string name, hash oh, SwaggerSchema swagger) ;
1876 public:
1877 
1878 
1880  string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv, string name, bool decl);
1881 
1882 
1883  // returns an example value for a REST API call
1884  any getExampleValue();
1885 
1886 
1888  check(bool serialize, bool request, string path, string method, string name, reference value);
1889 
1890 
1891 
1892 private:
1893  checkObjectProperty(string name, string prop);
1894 public:
1895 
1896 
1898 
1899 private:
1900  checkIntern(bool serialize, bool request, string type, string path, string method, string name, hash v, reference<hash> value);
1901 public:
1902 
1903 
1905 
1906 private:
1907  static checkValueType(any value, string type, *SchemaObject items, *string loc);
1908 public:
1909 
1910 
1912 
1923  static SchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
1924 
1926 
1928  static SchemaObject newSchemaObject(string name, any error, SwaggerSchema swagger);
1929 };
1930 
1933 
1934 public:
1935  public :
1937 
1951 
1952 public:
1953 
1955 
1968 private:
1969  constructor(string name, hash oh, SwaggerSchema swagger) ;
1970 public:
1971 
1972 
1974 
1986  static ParameterItemsSchemaObject newSchemaObject(string name, hash oh, SwaggerSchema swagger);
1987 
1989 
1991  static ParameterItemsSchemaObject newSchemaObject(string name, any error, SwaggerSchema swagger);
1992 };
1993 
1995 
2000 class XmlObject : public ObjectBase {
2001 
2002 public:
2003  public :
2005 
2012  *string name;
2013 
2015  *string ns;
2016 
2018  *string prefix;
2019 
2021  bool attribute = False;
2022 
2024 
2028  bool wrapped = False;
2029 
2030 public:
2031 
2033 
2038  constructor(hash oh) ;
2039 
2040 };
2041 
2043 
2049 
2050 public:
2051  public :
2053  string type;
2054 
2056  *string desc;
2057 
2059 
2062  *string name;
2063 
2065 
2068  *string inLoc;
2069 
2071 
2076  *string flow;
2077 
2079 
2083 
2085 
2088  *string tokenUrl;
2089 
2091 
2099 
2100 public:
2101 
2103 
2112  constructor(hash oh) ;
2113 
2114 };
2115 
2117 class ScopesObject : public ObjectBase {
2118 
2119 public:
2120  public :
2122 
2125  hash<string, string> fields;
2126 
2127 public:
2128 
2130 
2135  constructor(hash oh) ;
2136 
2137 };
2138 
2139 } // end namespace swagger
2140 
2141 // private namespace for internal definitions
2142 namespace Priv {
2143  const SwaggerListToSet = -1;
2144  const SwaggerListToHashOfStrings = -2;
2145 
2146  const TypeMap = (
2147  NT_INT: "int",
2148  NT_STRING: "string",
2149  NT_FLOAT: "float",
2150  NT_LIST: "list",
2151  NT_HASH: "hash",
2152  NT_NOTHING: "nothing",
2153  NT_BOOLEAN: "bool",
2154  SwaggerListToSet: "list<string>",
2155  );
2156 
2158 
2168  required_field(string objType, hash oh, string name, int typeCode, reference<any> target);
2169 
2170 
2172 
2183  bool optional_field(string objType, hash oh, string name, int typeCode, reference<any> target);
2184 
2185 
2187 
2198  bool optional_field(string objType, hash oh, string name, hash<string, bool> typeCodes, reference<any> target);
2199 
2200 
2202  check_type_code(string objType, string name, any val, int typeCode);
2203 
2204 
2206  get_value(string objType, string name, int typeCode, any val, reference<any> target);
2207 
2208 
2210  string get_qore_type(string name, string type, *string format, *SchemaObject items);
2211 
2212 }
hash< string, bool > produces
A set of MIME types (strings) the APIs can produce.
Definition: Swagger.qm.dox.h:451
Describes the operations available on a single path.
Definition: Swagger.qm.dox.h:963
Base used by OtherParameter, HeaderObject and SchemaObject.
Definition: Swagger.qm.dox.h:235
hash< string, ResponseObject > responses
Definition: Swagger.qm.dox.h:1559
date date(date dt)
ResponseObject defaultResp
Definition: Swagger.qm.dox.h:1552
string pfx
path prefix
Definition: Swagger.qm.dox.h:875
hash< string, bool > consumes
A set of MIME types (strings) the APIs can consume.
Definition: Swagger.qm.dox.h:444
This class stores the path tree for URI path matching.
Definition: Swagger.qm.dox.h:923
*PathItemObject pio
the PathItemObject associated with this path (if any)
Definition: Swagger.qm.dox.h:884
PathsObject paths
Required. The available paths and operations for the API.
Definition: Swagger.qm.dox.h:412
const NT_NOTHING
const ValidStringFormatsHash
A hash of valid string type formats.
Definition: Swagger.qm.dox.h:162
SchemaObject schema
Required. The schema defining the type used for the body parameter.
Definition: Swagger.qm.dox.h:1397
string name
Required. The name of the parameter. Parameter names are case sensitive.
Definition: Swagger.qm.dox.h:1337
Describes a single API operation on a path.
Definition: Swagger.qm.dox.h:1040
*string email
The email address of the contact person/organization. MUST be in the format of an email address...
Definition: Swagger.qm.dox.h:825
*ExternalDocumentationObject externalDocs
Additional external documentation.
Definition: Swagger.qm.dox.h:504
This is the root document object for the API specification. It combines what previously was the Resou...
Definition: Swagger.qm.dox.h:397
*int maxProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.1.
Definition: Swagger.qm.dox.h:1762
string url
Required. The URL for the target documentation. Value MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1273
const ValidNumberFormatsHash
A hash of valid number type formats.
Definition: Swagger.qm.dox.h:160
string title
Required. The title of the application.
Definition: Swagger.qm.dox.h:783
*string prefix
The prefix to be used for the name.
Definition: Swagger.qm.dox.h:2018
*string name
The name of the header or query parameter to be used.
Definition: Swagger.qm.dox.h:2062
hash< string, PathComponent > paths
hash of non-wildcard paths to the next level
Definition: Swagger.qm.dox.h:887
*PathComponent wildcard
if there is a wildcard to a PathComponent
Definition: Swagger.qm.dox.h:881
string name
Required. The name of the tag.
Definition: Swagger.qm.dox.h:1710
Holds the relative paths to the individual endpoints.
Definition: Swagger.qm.dox.h:870
*ExternalDocumentationObject externalDocs
Additional external documentation for this tag.
Definition: Swagger.qm.dox.h:1716
Allows the definition of a security scheme that can be used by the operations.
Definition: Swagger.qm.dox.h:2048
*SchemaObject items
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.1.
Definition: Swagger.qm.dox.h:1756
*string name
The identifying name of the contact person/organization.
Definition: Swagger.qm.dox.h:819
main namespace for all public Swagger declarations
Definition: Swagger.qm.dox.h:136
string name
current component name
Definition: Swagger.qm.dox.h:878
defines an object in a schema
Definition: Swagger.qm.dox.h:1732
const MimeDataTypes
supported mime types for de/serializing data
Definition: Swagger.qm.dox.h:165
AbstractParameterObject specialization for "body" parameters.
Definition: Swagger.qm.dox.h:1392
Lists the available scopes for an OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2117
const True
const MimeDataTypes const MimeContentTypes
MIME types for data serialization.
Definition: Swagger.qm.dox.h:192
string method
the HTTP method for the operation
Definition: Swagger.qm.dox.h:1048
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:264
list< string > schemes
The transfer protocol for the operation.
Definition: Swagger.qm.dox.h:1119
*string termsOfService
The Terms of Service for the API.
Definition: Swagger.qm.dox.h:789
list< TagObject > tags
A list of tags used by the specification with additional metadata.
Definition: Swagger.qm.dox.h:501
const NT_FLOAT
A metadata object that allows for more fine-tuned XML model definitions.
Definition: Swagger.qm.dox.h:2000
const MimeTypeMultipartFormData
const ParameterCollectionFormats
valid parameter collection formats
Definition: Swagger.qm.dox.h:153
hash< string, bool > produces
A hash of MIME types (strings) the operation can produce.
Definition: Swagger.qm.dox.h:1095
*string inLoc
The location of the API key. Valid values are "query" or "header".
Definition: Swagger.qm.dox.h:2068
string path
the URI path for the operation
Definition: Swagger.qm.dox.h:1045
number number(softnumber n)
*ExternalDocumentationObject externalDocs
Additional external documentation for this schema.
Definition: Swagger.qm.dox.h:1840
const NT_LIST
binary binary()
const ValidSchemes
Valid transfer protocol schemes.
Definition: Swagger.qm.dox.h:195
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:489
initialize(hash oh)
Initialize.
hash< string, bool > schemes
The transfer protocol of the API.
Definition: Swagger.qm.dox.h:437
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:1785
string name
Required. The license name used for the API.
Definition: Swagger.qm.dox.h:845
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:276
const False
string type
Required. The type of the object.
Definition: Swagger.qm.dox.h:1653
*string host
The host (name or IP) serving the API.
Definition: Swagger.qm.dox.h:421
*string def_path
the default path to use when retrieving external schema references
Definition: Swagger.qm.dox.h:520
list list(...)
hash< string, bool > consumes
A list of MIME types (strings) the operation can consume.
Definition: Swagger.qm.dox.h:1087
*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:1347
string name
the name of this object for documentation and example purposes
Definition: Swagger.qm.dox.h:1737
string swaggerSpec
Swagger Specification version being used.
Definition: Swagger.qm.dox.h:406
const MimeTypeFormUrlEncoded
*string desc
A short description for security scheme.
Definition: Swagger.qm.dox.h:2056
*ContactObject contact
The contact information for the exposed API.
Definition: Swagger.qm.dox.h:795
AbstractParameterObject body
the body parameter, if defined for this operation
Definition: Swagger.qm.dox.h:1109
hash mime_parse_form_urlencoded_string(string str)
Describes a single operation parameter.
Definition: Swagger.qm.dox.h:1325
*int maxItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
Definition: Swagger.qm.dox.h:261
License information for the exposed API.
Definition: Swagger.qm.dox.h:840
const ValidStringFormats
Valid string type formats.
Definition: Swagger.qm.dox.h:142
*bool exclusiveMin
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:249
const MimeTypeYamlRpc
*string desc
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1753
string type
Required. The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Definition: Swagger.qm.dox.h:2053
string version
Required. Provides the version of the application API (not to be confused with the specification vers...
Definition: Swagger.qm.dox.h:792
*ScopesObject scopes
The available scopes for the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2098
*int maxLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
Definition: Swagger.qm.dox.h:252
*string desc
A short description of the target documentation. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1270
string type
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.2.
Definition: Swagger.qm.dox.h:1744
const CollectionFormats
allowed collection formats
Definition: Swagger.qm.dox.h:145
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1443
AbstractParameterObject specialization for parameters other than "body".
Definition: Swagger.qm.dox.h:1426
Base class for the Swagger specification objects, wrapping the vendor extensions. ...
Definition: Swagger.qm.dox.h:199
hash< string, SecuritySchemeObject > securityDefinitions
Security scheme definitions that can be used across the specification.
Definition: Swagger.qm.dox.h:475
PathComponent paths
the tree of path components for path matching with wildcards
Definition: Swagger.qm.dox.h:928
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1747
list tags
A list of tags (strings or TagObjects) for API documentation control.
Definition: Swagger.qm.dox.h:1054
const NT_INT
const NT_BOOLEAN
const ValidNumberFormats
Valid number type formats.
Definition: Swagger.qm.dox.h:140
any additionalProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:1779
*ParameterItemsSchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1454
const ScalarTypes
valid scalar types
Definition: Swagger.qm.dox.h:1846
*string name
Replaces the name of the element/attribute used for the described schema property.
Definition: Swagger.qm.dox.h:2012
hash< string, ResponseObject > responses
Response definitions that can be used across operations. This property does not define global respons...
Definition: Swagger.qm.dox.h:469
AbstractParameterObject body
The body parameter, if defined for this path.
Definition: Swagger.qm.dox.h:988
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:1772
string desc
Required. A short description of the response. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1584
InfoObject info
Required. Provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:409
hash< string, OperationObject > operations
A hash of OperationObjects correspoding to different methods.
Definition: Swagger.qm.dox.h:1004
*string basePath
The base path on which the API is served, which is relative to the host.
Definition: Swagger.qm.dox.h:429
any defaultVal
Declares the value of the parameter that the server will use if none is provided. ...
Definition: Swagger.qm.dox.h:1480
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1671
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:243
any defaultVal
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.
Definition: Swagger.qm.dox.h:1759
*int minProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.2.
Definition: Swagger.qm.dox.h:1765
*bool uniqueItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.
Definition: Swagger.qm.dox.h:267
*string flow
The flow used by the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2076
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details...
Definition: Swagger.qm.dox.h:1656
Contact information for the exposed API.
Definition: Swagger.qm.dox.h:814
Allows referencing an external resource for extended documentation.
Definition: Swagger.qm.dox.h:1265
*string operationId
Unique string used to identify the operation.
Definition: Swagger.qm.dox.h:1079
*string url
The URL pointing to the contact information. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:822
*string desc
A short description of the header.
Definition: Swagger.qm.dox.h:1646
*string url
A URL to the license used for the API. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:848
string string(softstring str, *string enc)
*string ref
Allows for an external definition of this path item.
Definition: Swagger.qm.dox.h:973
*string ns
The URL of the namespace definition. Value SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2015
*bool exclusiveMax
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:246
*float maximum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:240
Definition: Swagger.qm.dox.h:2142
const ValidIntFormatsHash
A hash of valid integer type formats.
Definition: Swagger.qm.dox.h:158
ResponsesObject responses
Required. The list of possible responses as they are returned from executing this operation...
Definition: Swagger.qm.dox.h:1112
*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:2088
*string desc
A short description of the application. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:786
*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:2082
const NT_HASH
string inLoc
Required. The location of the parameter.
Definition: Swagger.qm.dox.h:1344
const ValidIntFormats
Valid integer type formats.
Definition: Swagger.qm.dox.h:138
bool compact_serialization
if serialized data should be subject to compact serialization (default: True)
Definition: Swagger.qm.dox.h:517
*SchemaObject schema
A definition of the response structure.
Definition: Swagger.qm.dox.h:1593
*string desc
A short description for the tag. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1713
*ExternalDocumentationObject externalDocs
Additional external documentation for this operation.
Definition: Swagger.qm.dox.h:1070
*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:523
list< hash< string, list< string > > > security
A declaration of which security schemes are applied for this operation.
Definition: Swagger.qm.dox.h:1134
items schema object for non-body parameters
Definition: Swagger.qm.dox.h:1932
describes a single HTTP header
Definition: Swagger.qm.dox.h:1641
contains the possible responses for an operation
Definition: Swagger.qm.dox.h:1544
any defaultVal
Declares the value of the header that the server will use if none is provided.
Definition: Swagger.qm.dox.h:1680
hash vendorExtensions
Allows extensions to the Swagger Schema.
Definition: Swagger.qm.dox.h:208
hash hash(object obj)
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1950
const SerializationModules
modules available for data serialization and/or deserialization
Definition: Swagger.qm.dox.h:189
any example
A free-form property to include an example of an instance for this schema.
Definition: Swagger.qm.dox.h:1843
*string title
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:1750
*string pattern
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
Definition: Swagger.qm.dox.h:258
The object provides metadata about the API. The metadata can be used by the clients if needed...
Definition: Swagger.qm.dox.h:778
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1470
hash headers
A hash of headers that are (can be) sent with the response.
Definition: Swagger.qm.dox.h:1599
*SchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1659
Used for loading the Swagger definitions.
Definition: Swagger.qm.dox.h:359
hash examples
A hash of example response messages.
Definition: Swagger.qm.dox.h:1609
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:2125
*string discriminator
Adds support for polymorphism.
Definition: Swagger.qm.dox.h:1806
string type
Required. The type of the parameter.
Definition: Swagger.qm.dox.h:1440
Describes a single response from an API Operation.
Definition: Swagger.qm.dox.h:1579
Allows adding metadata to a single tag that is used by the OperationObject. It is not mandatory to ha...
Definition: Swagger.qm.dox.h:1705
*XmlObject xml
This MAY be used only on properties schemas. It has no effect on root schemas.
Definition: Swagger.qm.dox.h:1837
*string desc
A verbose explanation of the operation behavior. GFM syntax can be used for rich text representation...
Definition: Swagger.qm.dox.h:1060
*string summary
A short summary of what the operation does.
Definition: Swagger.qm.dox.h:1057
*LicenseObject license
The license information for the exposed API.
Definition: Swagger.qm.dox.h:798
*int minLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
Definition: Swagger.qm.dox.h:255