Qore Swagger Module Reference 2.2.0
Loading...
Searching...
No Matches
Swagger.qm.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* Swagger.qm Copyright (C) 2017 - 2023 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
33
239namespace Swagger {
246
248const LM_LAX_COLLECTIONFORMAT = (1 << 1);
249
252
255
257const LM_AUTO_FORM_DATA = (1 << 4);
258
260const LM_ALL = ...;
261
263
265const ValidIntFormats = ("int32", "int64");
267const ValidNumberFormats = ("double", "float");
269const ValidStringFormats = ("binary", "byte", "date", "date-time", "password");
270
273
274
277
278
280const ValidIntFormatsHash = map {$1: True}, ValidIntFormats;
285
288 "serialize": \make_yaml(),
289 "serialize_verbose": string sub (auto val) {return make_yaml(val, BlockStyle);},
290 "deserialize": \parse_yaml(),
291 "module": "yaml",
292};
293
296%ifndef NoJson
297 MimeTypeJson: (
298 "serialize": \make_json(),
299 "serialize_verbose": string sub (auto val) {return make_json(val, JGF_ADD_FORMATTING);},
300 "deserialize": \parse_json(),
301 "module": "json",
302 ),
303%endif
304%ifndef NoYaml
305 // issue #3699: more YAML MIME types must be supported
306 MimeTypeYaml: YamlSerialization,
307 MimeTypeYamlRpc: YamlSerialization,
308 "text/yaml": YamlSerialization,
309 "application/yaml": YamlSerialization,
310%endif
311%ifndef NoXml
312 MimeTypeXmlApp: (
313 "serialize": \make_xml(),
314 "serialize_verbose": string sub (auto val) {return make_xml(val, XGF_ADD_FORMATTING);},
315 "deserialize": \parse_xml(),
316 "module": "xml",
317 ),
318%endif
319 # Content-Type: application/x-www-form-urlencoded
320 MimeTypeFormUrlEncoded: (
321 "serialize": \mime_get_form_urlencoded_string(),
322 "serialize_verbose": \mime_get_form_urlencoded_string(),
323 "deserialize": \mime_parse_form_urlencoded_string(),
324 ),
325 # Content-Type: multipart/form-data (handled manually)
326 MimeTypeMultipartFormData: {},
327};
328
330const SerializationModules = keys (map {$1.module: True}, MimeDataTypes.iterator(), $1.module);
331
334
336const ValidSchemes = ("http", "https", "ws", "wss");
337const ValidSchemesHash = map {$1: True}, ValidSchemes;
338
341
342public:
344
349
352
353
355
358 constructor(hash<auto> oh);
359
360
363
364
366
369 initialize(hash<auto> oh);
370};
371
374
375public:
377 *float maximum;
378
380 *float minimum;
381
384
387
390
393
395 *string pattern;
396
399
402
405
407
410 hash<string, bool> enum;
411
414
416
419 constructor(string objType, hash<auto> oh);
420
421
424
425
427protected:
428 auto getExampleValue(string type, *string format);
429public:
430
431
433protected:
434 check(bool serialize, bool request, string type, *string format, *SchemaObject items, string path, string method, string name, reference<auto> value);
435public:
436
437
438protected:
439 checkStringIntern(string path, string method, string name, string value);
440public:
441
442
443protected:
444 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, list<auto> v, reference<list> value);
445public:
446
447
448protected:
449 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, hash<auto> v, reference<hash> value);
450public:
451
452
453protected:
454 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, int v, reference<auto> value);
455public:
456
457
458protected:
459 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, number v, reference<number> value);
460public:
461
462
463protected:
464 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, float v, reference<number> value);
465public:
466
467
468protected:
469 checkInternNumber(bool serialize, bool request, string type, *string format, string path, string method, string name, auto v, reference<auto> value);
470public:
471
472
474protected:
475 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, binary v, reference value);
476public:
477
478
480protected:
481 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, string v, reference<auto> value);
482public:
483
484
486protected:
487 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, date v, reference value);
488public:
489
490
491protected:
492 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, bool v, reference<bool> value);
493public:
494
495
496protected:
497 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, nothing v, reference<nothing> value);
498public:
499
500
502protected:
503 checkArrayParam(bool serialize, bool request, SchemaObject items, string path, string method, string name, reference<softlist<auto>> value);
504public:
505
506
508protected:
509 static throwInvalidType(string name, string actual, string expected, auto value);
510public:
511
512
514
516 static bool checkValueType(reference<auto> value, string type);
517};
518
521
522public:
524
540 static SwaggerSchema fromString(string swaggerSpecification, *bool json, *hash<auto> opts);
541
543
559 static SwaggerSchema fromFile(string filepath, *hash<auto> opts);
560
562
581 static SwaggerSchema fromUrl(string url, *bool json, *hash<auto> opts);
582
584
593 static hash<auto> parseSchemaContent(string filepath, string str);
594
596 static hash<auto> parseSchemaSource(string str, string ser);
597
599 static string detectSourceEncoding(string str);
600};
601
603class SwaggerSchema : public ObjectBase, public AbstractRestSchemaValidator {
604
605public:
607
612
615
618
620
626 *string host;
627
629
634 *string basePath;
635
637
642 hash<string, bool> schemes;
643
645
649 hash<string, bool> consumes;
650
652
656 hash<string, bool> produces;
657
659
662 hash<string, SchemaObject> definitions();
663
665
668 hash<string, AbstractParameterObject> parameters();
669
671
674 hash<string, ResponseObject> responses;
675
677
680 hash<string, SecuritySchemeObject> securityDefinitions;
681
683
694 hash<string, softlist<string>> security;
695
697
706 list<TagObject> tags;
707
710
712 const SwaggerOptions = ...;
713
714
715protected:
718
720 *string def_path;
721
723
726
728 string hash_str;
729
732
734 hash<string, hash<string, SchemaObject>> so_map;
735
736public:
737
738private:
741
742public:
743
745
764 constructor(string schema_source, hash<auto> oh, *hash<auto> opts) ;
765
766
768
787 constructor(LoggerInterface logger, string schema_source, hash<auto> oh, *hash<auto> opts) ;
788
789
791protected:
792 constructorIntern(string schema_source, hash<auto> oh, *hash<auto> opts);
793public:
794
795
796 *int getParseFlags();
797
798
799 *SchemaObject tryGetSchemaObject(string name, hash<auto> oh, reference<string> hash_str);
800
801
802 cacheSchemaObject(string name, string hash_str, SchemaObject so);
803
804
806
808 SchemaObject resolveSchemaObject(string name, string refstr, hash<auto> oh);
809
810
812
814 ParameterItemsSchemaObject resolveParameterItemsSchemaObject(string name, string refstr, hash<auto> oh);
815
816
818
820 AbstractParameterObject resolveParameter(string name, string refstr, hash<auto> oh);
821
822
824
826 ResponseObject resolveResponse(string name, string refstr, hash<auto> oh);
827
828
830
834protected:
835 string getHashImpl();
836public:
837
838
840
844protected:
846public:
847
848
850
863protected:
864 hash<RestSchemaValidator::RestRequestClientInfo> processRequestImpl(string method, string path, auto body, *hash<auto> headers, *softlist<string> content_types);
865public:
866
867
869
880protected:
881 hash<RestSchemaValidator::RestRequestServerInfo> parseRequestImpl(string method, string path, *data http_body, reference<hash> headers);
882public:
883
884
886
905protected:
906 hash<HttpResponseInfo> processResponseImpl(string method, string path, int code, auto response_body, *hash<auto> headers, *softlist<string> content_types);
907public:
908
909
911
921protected:
922 hash<RestSchemaValidator::RestResponseClientInfo> parseResponseImpl(string method, string path, int code, *data response_body, hash<auto> hdr);
923public:
924
925
927protected:
928 fixPath(reference<string> path);
929public:
930
931
933
935protected:
936 hash<string, list<string>> getPathOperationHashImpl();
937public:
938
939
941
945protected:
947public:
948
949
951
953protected:
955public:
956
957
959
964protected:
965 hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(string method, string path);
966public:
967
968
970
976protected:
977 hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequestImpl(string method, string path, *softlist<string> content_types);
978public:
979
980
982
988protected:
989 hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(string method, string path, int code);
990public:
991
992
994
1001protected:
1002 hash<RestExampleResponseInfo> getExampleResponseImpl(string method, string path, int code, *softlist<string> content_types);
1003public:
1004
1005
1007
1009protected:
1010 hash<auto> getExternalReference(string refstr);
1011public:
1012
1013
1015
1019protected:
1020 AbstractDataProvider getDataProviderImpl(HTTPClient rest);
1021public:
1022
1023
1025
1029protected:
1031public:
1032
1033
1035
1039protected:
1041public:
1042
1043
1045
1059private:
1060 hash<RestSchemaValidator::RestRequestClientInfo> processRequestIntern(string method, string path, auto body, *hash<auto> headers, *softlist<string> content_types, bool compact_serialization);
1061public:
1062
1063
1065
1085private:
1086 hash<HttpResponseInfo> processResponseIntern(string method, string path, int code, auto response_body, *hash<auto> headers, *softlist<string> content_types, bool compact_serialization);
1087public:
1088
1089
1091
1099private:
1100 bool checkRequestContentTypeHeader(reference<hash<RestRequestClientInfo>> req, auto body, *hash<auto> headers);
1101public:
1102
1103
1105
1113private:
1114 bool checkResponseContentTypeHeader(reference<hash<HttpResponseInfo>> resp, auto body, *hash<auto> headers);
1115public:
1116
1117
1119
1126private:
1127 bool checkResponseTextPlain(reference<hash<HttpResponseInfo>> resp, auto body, hash<string, bool> mime_types, *list<auto> content_types);
1128public:
1129
1130
1132private:
1133 SchemaObject processDefinition(string key, auto value);
1134public:
1135
1136};
1137
1139class InfoObject : public ObjectBase {
1140
1141public:
1143 string title;
1144
1146 *string desc;
1147
1150
1152 string version;
1153
1156
1159
1161
1167 constructor(hash<auto> oh) ;
1168
1169};
1170
1173
1174public:
1176 *string name;
1177
1179 *string url;
1180
1182 *string email;
1183
1185
1190 constructor(hash<auto> oh) ;
1191
1192};
1193
1196
1197public:
1199 string name;
1200
1202 *string url;
1203
1205
1211 constructor(hash<auto> oh) ;
1212
1213};
1214
1216
1223
1224public:
1225protected:
1227 string pfx;
1228
1230 string name;
1231
1234
1237
1239 hash<string, PathComponent> paths;
1240
1241public:
1242
1244 constructor(hash<auto> oh, string pfx, SwaggerSchema swagger);
1245
1246
1248protected:
1249 constructor(string full_path, list<auto> l, int offset, hash<auto> oh);
1250public:
1251
1252
1254protected:
1255 add(string full_path, list<auto> l, int offset, hash<auto> oh, SwaggerSchema swagger);
1256public:
1257
1258
1260
1262 PathItemObject match(list<auto> path);
1263
1264
1266
1268 *PathItemObject tryMatch(list<auto> path);
1269
1270
1272
1274 getPathOperationHash(reference<hash<string, list<string>>> h);
1275
1276};
1277
1279class PathsObject : public ObjectBase {
1280
1281public:
1282protected:
1285
1286public:
1287
1289
1297 constructor(hash<auto> oh, SwaggerSchema swagger) ;
1298
1299
1301
1303 PathItemObject match(string path);
1304
1305
1307
1310
1311
1313
1315 hash<string, list<string>> getPathOperationHash();
1316
1317};
1318
1320
1326
1327public:
1329
1334 *string ref;
1335
1337
1346 hash<string, AbstractParameterObject> parameters();
1347
1350
1351protected:
1353
1363 hash<string, OperationObject> operations;
1364
1365public:
1366
1368
1377 constructor(string path, hash<auto> oh, SwaggerSchema swagger) ;
1378
1379
1381
1388 OperationObject getOperation(string method, string path);
1389
1390
1392
1394 softlist getMethods();
1395
1396};
1397
1400
1401public:
1403 string path;
1404
1406 string method;
1407
1409
1412 list tags;
1413
1415 *string summary;
1416
1418 *string desc;
1419
1421
1425 bool deprec = False;
1426
1429
1431
1438
1440
1445 hash<string, bool> consumes;
1446
1448
1453 hash<string, bool> produces;
1454
1456
1464 hash<string, AbstractParameterObject> parameters();
1465
1468
1470 hash<string, AbstractParameterObject> formData;
1471
1474
1476
1480 list<string> schemes;
1481
1483
1495 list<hash<string, list<string>>> security;
1496
1498
1507 constructor(string path, string method, hash<auto> oh, SwaggerSchema swagger) ;
1508
1509
1511 *data getRequestBody(PathItemObject pio, auto body, reference<hash<auto>> headers);
1512
1513
1515
1525 validateRequest(bool serialize, PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers, *reference<hash<string, bool>> mime_types);
1526
1527
1529
1539 parseRequest(PathItemObject pio, reference<hash<UriQueryInfo>> h, reference<auto> body, reference<hash> headers);
1540
1541
1543 validateResponse(string method, string path, PathItemObject pio, int http_code, reference<auto> response_body, reference<hash<string, bool>> mime_types, bool deserialize = True);
1544
1545
1547
1554 hash<RestQoreExampleCodeInfo> getQoreExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger);
1555
1556
1558
1567 hash<RestSchemaValidator::RestExampleRequestInfo> getExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger, reference rbody);
1568
1569
1571
1578 hash<RestQoreExampleCodeInfo> getQoreExampleResponse(string method, string path, int code);
1579
1580
1582
1590 hash<RestExampleResponseInfo> getExampleResponse(string method, string path, int code, reference<auto> body);
1591
1592
1593protected:
1594 getQoreExampleParams(reference<hash<auto>> query, reference<hash<auto>> headers, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1595public:
1596
1597
1599protected:
1600 doDefaultParams(reference<hash<UriQueryInfo>> h, reference<hash> headers, reference<auto> body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1601public:
1602
1603
1605protected:
1606 checkMissingParams(hash<UriQueryInfo> h, *hash<auto> headers, auto body, hash<string, AbstractParameterObject> parameters, *hash<string, AbstractParameterObject> child_params);
1607public:
1608
1609
1611
1613protected:
1615public:
1616
1617
1619protected:
1620 error(string err, string fmt);
1621public:
1622
1623};
1624
1627
1628public:
1630 *string desc;
1631
1633 string url;
1634
1636
1642 constructor(hash<auto> oh) ;
1643
1644};
1645
1647
1684
1685public:
1687
1694 string name;
1695
1697
1701 string inLoc;
1702
1704 *string desc;
1705
1707
1712 bool required = False;
1713
1714protected:
1715 const OtherParameterMap = ...;
1716
1717
1718public:
1719
1721
1728 constructor(hash<auto> oh, *int opt_flags) ;
1729
1730
1732 abstract check(bool serialize, bool request, string path, string method, string name, reference value);
1733
1736
1737
1739 static AbstractParameterObject newParameter(string name, hash<auto> oh, SwaggerSchema swagger);
1740};
1741
1744
1745public:
1748
1750
1757 constructor(hash<auto> oh, SwaggerSchema swagger) ;
1758
1759
1761 check(bool serialize, bool request, string path, string method, string name, reference value);
1762
1763
1765 string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv);
1766
1767
1768 // returns an example value for a REST API call
1769 auto getExampleValue();
1770
1771};
1772
1775
1776public:
1778
1787 string type;
1788
1790 *string format;
1791
1793
1798 bool allowEmptyValue = False;
1799
1802
1804
1818
1820
1828
1830 const ParameterTypes = ...;
1831
1832
1834
1844 constructor(string name, hash<auto> oh, SwaggerSchema swagger) ;
1845
1846
1848 check(bool serialize, bool request, string path, string method, string name, reference<auto> value);
1849
1850
1853
1854
1857
1858
1860protected:
1861 static checkValueType(reference<auto> value, string type, *SchemaObject items, *string loc);
1862public:
1863
1864};
1865
1868
1869public:
1870 // The documentation of responses other than the ones declared for specific HTTP response codes.
1875
1876 // A hash mapping HTTP status codes to @ref ResponseObject "ResponseObjects".
1881 hash<string, ResponseObject> responses;
1882
1884
1894 constructor(string path, string method, hash<auto> oh, SwaggerSchema swagger) ;
1895
1896};
1897
1900
1901public:
1903 string desc;
1904
1906
1913
1915
1918 hash<auto> headers;
1919
1921
1929
1931
1939protected:
1940 constructor(string key, hash<auto> oh, SwaggerSchema swagger) ;
1941public:
1942
1943
1945
1954 static ResponseObject newResponse(string key, hash<auto> oh, SwaggerSchema swagger);
1955};
1956
1958class HeaderObject : public ObjectBase, public SchemaBase {
1959
1960public:
1962 *string desc;
1963
1965
1969 string type;
1970
1972 *string format;
1973
1976
1978
1988
1990
1997
1999
2007 constructor(hash<auto> oh, SwaggerSchema swagger) ;
2008
2009
2011protected:
2012 static checkValueType(reference<auto> value, string type, *SchemaObject items, *string loc);
2013public:
2014
2015};
2016
2018class TagObject : public ObjectBase {
2019
2020public:
2022 string name;
2023
2025 *string desc;
2026
2029
2031
2037 constructor(hash<auto> oh) ;
2038
2039};
2040
2042class SchemaObject : public ObjectBase, public SchemaBase {
2043
2044public:
2046 string name;
2047
2049
2053 string type;
2054
2056 *string format;
2057
2059 *string title;
2060
2062 *string desc;
2063
2066
2069
2072
2075
2077
2079 bool nullable = False;
2080
2082
2086 hash<string, SchemaObject> properties;
2087
2089
2094
2096
2099 hash<string, bool> required;
2100
2102
2121
2123
2130 bool readOnly = False;
2131
2133
2141 list<SchemaObject> allOf();
2142
2144
2152
2155
2158
2160 const ScalarTypes = ...;
2161
2162
2164 const ReferenceTypes = ...;
2165
2166
2168
2181protected:
2182 constructor(string name, hash<auto> oh, SwaggerSchema swagger, *string hash_str, *bool require_items) ;
2183public:
2184
2185
2187 string getQoreExample(reference<hash<RestQoreExampleCodeInfo>> rv, string name, bool decl);
2188
2189
2190 // returns an example value for a REST API call
2191 auto getExampleValue();
2192
2193
2195 check(bool serialize, bool request, string path, string method, string name, reference<auto> value);
2196
2197
2198protected:
2199 checkObjectProperty(string name, string prop);
2200public:
2201
2202
2204protected:
2205 checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, hash<auto> v, reference<hash<auto>> value);
2206public:
2207
2208
2210protected:
2211 static checkValueType(reference<auto> value, string type, *SchemaObject items, *string loc);
2212public:
2213
2214
2216
2227 static SchemaObject newSchemaObject(string name, hash<auto> oh, SwaggerSchema swagger, *bool require_items);
2228
2230
2232 static SchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger);
2233};
2234
2237
2238public:
2240
2254
2256
2268protected:
2269 constructor(string name, hash<auto> oh, SwaggerSchema swagger) ;
2270public:
2271
2272
2274
2286 static ParameterItemsSchemaObject newSchemaObject(string name, hash<auto> oh, SwaggerSchema swagger);
2287
2289
2292};
2293
2295
2300class XmlObject : public ObjectBase {
2301
2302public:
2304
2311 *string name;
2312
2314 *string ns;
2315
2317 *string prefix;
2318
2320 bool attribute = False;
2321
2323
2327 bool wrapped = False;
2328
2330
2335 constructor(hash<auto> oh) ;
2336
2337};
2338
2340
2346
2347public:
2349 string type;
2350
2352 *string desc;
2353
2355
2358 *string name;
2359
2361
2364 *string inLoc;
2365
2367
2372 *string flow;
2373
2375
2379
2381
2384 *string tokenUrl;
2385
2387
2395
2397
2406 constructor(hash<auto> oh) ;
2407
2408};
2409
2411class ScopesObject : public ObjectBase {
2412
2413public:
2415
2418 hash<string, string> fields;
2419
2421
2426 constructor(hash<auto> oh) ;
2427
2428};
2429};
2430
2431// private namespace for internal definitions
2432namespace Priv {
2433 // a set of string values
2434 const SwaggerListToStringSet = -1;
2435 // a set of any type that can be converted to a string
2436 const SwaggerListToAnySet = -2;
2437 const SwaggerListToHashOfStrings = -3;
2438
2439 const TypeMap = ...;
2440
2441
2443
2453 required_field(string objType, hash<auto> oh, string name, int typeCode, reference<auto> target, *int opt_flags);
2454
2455
2457
2467 required_field(string objType, hash<auto> oh, string name, hash<string, bool> typeCodes, reference<auto> target);
2468
2469
2471
2482 bool optional_field(string objType, hash<auto> oh, string name, int typeCode, reference<auto> target, *int opt_flags);
2483
2484
2486
2497 bool optional_field(string objType, hash<auto> oh, string name, hash<string, bool> typeCodes, reference<auto> target);
2498
2499
2501 *bool check_type_code(string objType, hash<auto> oh, string name, auto val, int typeCode, *int opt_flags);
2502
2503
2505 get_value(string objType, string name, int typeCode, auto val, reference<auto> target);
2506
2507
2509 string get_qore_type(string name, string type, *string format, *SchemaObject items);
2510
2511};
Describes a single operation parameter.
Definition: Swagger.qm.dox.h:1683
bool required
Determines whether this parameter is mandatory.
Definition: Swagger.qm.dox.h:1712
auto getDefaultValue()
returns the default value of the parameter (default: NOTHING)
abstract check(bool serialize, bool request, string path, string method, string name, reference value)
verifies the parameter in an actual REST API call
constructor(hash< auto > oh, *int opt_flags)
Constructor.
string name
Required. The name of the parameter. Parameter names are case sensitive.
Definition: Swagger.qm.dox.h:1694
string inLoc
Required. The location of the parameter.
Definition: Swagger.qm.dox.h:1701
static AbstractParameterObject newParameter(string name, hash< auto > oh, SwaggerSchema swagger)
gets a concrete instance of an AbstractParameterObject
*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:1704
AbstractParameterObject specialization for "body" parameters.
Definition: Swagger.qm.dox.h:1743
string getQoreExample(reference< hash< RestQoreExampleCodeInfo > > rv)
generates Qore example code for a REST API call
SchemaObject schema
Required. The schema defining the type used for the body parameter.
Definition: Swagger.qm.dox.h:1747
check(bool serialize, bool request, string path, string method, string name, reference value)
verifies the parameter in an actual REST API call
constructor(hash< auto > oh, SwaggerSchema swagger)
Constructor.
Contact information for the exposed API.
Definition: Swagger.qm.dox.h:1172
constructor(hash< auto > oh)
Constructor.
*string name
The identifying name of the contact person/organization.
Definition: Swagger.qm.dox.h:1176
*string url
The URL pointing to the contact information. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1179
*string email
The email address of the contact person/organization. MUST be in the format of an email address.
Definition: Swagger.qm.dox.h:1182
Allows referencing an external resource for extended documentation.
Definition: Swagger.qm.dox.h:1626
*string desc
A short description of the target documentation. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1630
constructor(hash< auto > oh)
Constructor.
string url
Required. The URL for the target documentation. Value MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1633
describes a single HTTP header
Definition: Swagger.qm.dox.h:1958
*string desc
A short description of the header.
Definition: Swagger.qm.dox.h:1962
*SchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1975
auto defaultVal
Declares the value of the header that the server will use if none is provided.
Definition: Swagger.qm.dox.h:1996
string type
Required. The type of the object.
Definition: Swagger.qm.dox.h:1969
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details.
Definition: Swagger.qm.dox.h:1972
static checkValueType(reference< auto > value, string type, *SchemaObject items, *string loc)
validates default values
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1987
constructor(hash< auto > oh, SwaggerSchema swagger)
Constructor.
The object provides metadata about the API. The metadata can be used by the clients if needed,...
Definition: Swagger.qm.dox.h:1139
string version
Required. Provides the version of the application API (not to be confused with the specification vers...
Definition: Swagger.qm.dox.h:1152
constructor(hash< auto > oh)
Constructor.
string title
Required. The title of the application.
Definition: Swagger.qm.dox.h:1143
*LicenseObject license
The license information for the exposed API.
Definition: Swagger.qm.dox.h:1158
*ContactObject contact
The contact information for the exposed API.
Definition: Swagger.qm.dox.h:1155
*string termsOfService
The Terms of Service for the API.
Definition: Swagger.qm.dox.h:1149
*string desc
A short description of the application. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1146
License information for the exposed API.
Definition: Swagger.qm.dox.h:1195
constructor(hash< auto > oh)
Constructor.
string name
Required. The license name used for the API.
Definition: Swagger.qm.dox.h:1199
*string url
A URL to the license used for the API. MUST be in the format of a URL.
Definition: Swagger.qm.dox.h:1202
Base class for the Swagger specification objects, wrapping the vendor extensions.
Definition: Swagger.qm.dox.h:340
initialize(hash< auto > oh)
Initialize.
hash< auto > vendorExtensions
Allows extensions to the Swagger Schema.
Definition: Swagger.qm.dox.h:348
constructor(ObjectBase other)
copy constructor
constructor(hash< auto > oh)
Constructor.
constructor()
Constructor.
Describes a single API operation on a path.
Definition: Swagger.qm.dox.h:1399
list< string > schemes
The transfer protocol for the operation.
Definition: Swagger.qm.dox.h:1480
*string desc
A verbose explanation of the operation behavior. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1418
checkMissingParams(hash< UriQueryInfo > h, *hash< auto > headers, auto body, hash< string, AbstractParameterObject > parameters, *hash< string, AbstractParameterObject > child_params)
checks for missing params
hash< string, bool > produces
A hash of MIME types (strings) the operation can produce.
Definition: Swagger.qm.dox.h:1453
*ExternalDocumentationObject externalDocs
Additional external documentation for this operation.
Definition: Swagger.qm.dox.h:1428
string path
the URI path for the operation
Definition: Swagger.qm.dox.h:1403
validateResponse(string method, string path, PathItemObject pio, int http_code, reference< auto > response_body, reference< hash< string, bool > > mime_types, bool deserialize=True)
validates a response against the response definition, if any
*string summary
A short summary of what the operation does.
Definition: Swagger.qm.dox.h:1415
hash< string, AbstractParameterObject > parameters()
A hash of parameters that are applicable for this operation.
hash< RestQoreExampleCodeInfo > getQoreExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger)
returns example Qore code for the given request
string method
the HTTP method for the operation
Definition: Swagger.qm.dox.h:1406
AbstractParameterObject body
body parameter; if defined for this operation, formData parameter will be excluded
Definition: Swagger.qm.dox.h:1467
hash< RestQoreExampleCodeInfo > getQoreExampleResponse(string method, string path, int code)
returns example Qore code for the given response
*data getRequestBody(PathItemObject pio, auto body, reference< hash< auto > > headers)
Processes a generated request.
validateRequest(bool serialize, PathItemObject pio, reference< hash< UriQueryInfo > > h, reference< auto > body, reference< hash > headers, *reference< hash< string, bool > > mime_types)
processes a REST API client-side request to the operation
hash< RestExampleResponseInfo > getExampleResponse(string method, string path, int code, reference< auto > body)
returns a hash of example message information for the given request
parseRequest(PathItemObject pio, reference< hash< UriQueryInfo > > h, reference< auto > body, reference< hash > headers)
parses and processes a REST request on the server side
doDefaultParams(reference< hash< UriQueryInfo > > h, reference< hash > headers, reference< auto > body, hash< string, AbstractParameterObject > parameters, *hash< string, AbstractParameterObject > child_params)
add default parameters
ResponsesObject responses
Required. The list of possible responses as they are returned from executing this operation.
Definition: Swagger.qm.dox.h:1473
error(string err, string fmt)
raises an exception with context information
list tags
A list of tags (strings or TagObjects) for API documentation control.
Definition: Swagger.qm.dox.h:1412
*ResponseObject getResponse(int code)
returns the ResponseObject for hthe given HTTP code or NOTHING if none is configured
*string operationId
Unique string used to identify the operation.
Definition: Swagger.qm.dox.h:1437
hash< string, AbstractParameterObject > formData
formData parameter; if defined for this operation, body parameter will be excluded
Definition: Swagger.qm.dox.h:1470
hash< RestSchemaValidator::RestExampleRequestInfo > getExampleRequest(string method, string path, PathItemObject pio, SwaggerSchema swagger, reference rbody)
returns a hash of example message information for the given request
list< hash< string, list< string > > > security
A declaration of which security schemes are applied for this operation.
Definition: Swagger.qm.dox.h:1495
hash< string, bool > consumes
A list of MIME types (strings) the operation can consume.
Definition: Swagger.qm.dox.h:1445
bool deprec
Declares this operation to be deprecated.
Definition: Swagger.qm.dox.h:1425
constructor(string path, string method, hash< auto > oh, SwaggerSchema swagger)
Constructor.
AbstractParameterObject specialization for parameters other than "body".
Definition: Swagger.qm.dox.h:1774
constructor(string name, hash< auto > oh, SwaggerSchema swagger)
Constructor.
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details.
Definition: Swagger.qm.dox.h:1790
bool allowEmptyValue
Sets the ability to pass empty-valued parameters.
Definition: Swagger.qm.dox.h:1798
check(bool serialize, bool request, string path, string method, string name, reference< auto > value)
validates the value against the schema definition
const ParameterTypes
valid parameter types
Definition: Swagger.qm.dox.h:1830
auto defaultVal
Declares the value of the parameter that the server will use if none is provided.
Definition: Swagger.qm.dox.h:1827
auto getDefaultValue()
returns the default value of the parameter (default: NOTHING)
*ParameterItemsSchemaObject items
Required if type is "array". Describes the type of items in the array.
Definition: Swagger.qm.dox.h:1801
auto getExampleValue()
returns an example value of the parameter (default: NOTHING)
static checkValueType(reference< auto > value, string type, *SchemaObject items, *string loc)
validates default values
string type
Required. The type of the parameter.
Definition: Swagger.qm.dox.h:1787
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:1817
items schema object for non-body parameters
Definition: Swagger.qm.dox.h:2236
*string collectionFormat
Determines the format of the array if type array is used.
Definition: Swagger.qm.dox.h:2253
constructor(string name, hash< auto > oh, SwaggerSchema swagger)
private constructor; use newSchemaObject() instead
static ParameterItemsSchemaObject newSchemaObject(string name, hash< auto > oh, SwaggerSchema swagger)
returns a SchemaObject for the schema definition; resolves references
static ParameterItemsSchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger)
throws an "INVALID-FIELD-TYPE" exception
Holds the relative paths to the individual endpoints.
Definition: Swagger.qm.dox.h:1222
constructor(hash< auto > oh, string pfx, SwaggerSchema swagger)
creates the object
constructor(string full_path, list< auto > l, int offset, hash< auto > oh)
private constructor
add(string full_path, list< auto > l, int offset, hash< auto > oh, SwaggerSchema swagger)
adds a component or a Path Item Object to the tree
hash< string, PathComponent > paths
hash of non-wildcard paths to the next level
Definition: Swagger.qm.dox.h:1239
PathItemObject match(list< auto > path)
returns either a PathItemObject for the path
getPathOperationHash(reference< hash< string, list< string > > > h)
returns a hash of URI paths as keys with values as lists of supported HTTP methods
*PathItemObject tryMatch(list< auto > path)
returns either a PathItemObject for the path
string name
current component name
Definition: Swagger.qm.dox.h:1230
*PathComponent wildcard
if there is a wildcard to a PathComponent
Definition: Swagger.qm.dox.h:1233
string pfx
path prefix
Definition: Swagger.qm.dox.h:1227
*PathItemObject pio
the PathItemObject associated with this path (if any)
Definition: Swagger.qm.dox.h:1236
Describes the operations available on a single path.
Definition: Swagger.qm.dox.h:1325
hash< string, AbstractParameterObject > parameters()
A hash of parameters that are applicable for all the operations described under this path.
softlist getMethods()
returns a list of HTTP methods supported by this object
*string ref
Allows for an external definition of this path item.
Definition: Swagger.qm.dox.h:1334
hash< string, OperationObject > operations
A hash of OperationObjects correspoding to different methods.
Definition: Swagger.qm.dox.h:1363
OperationObject getOperation(string method, string path)
returns the operation object for the given method
AbstractParameterObject body
The body parameter, if defined for this path.
Definition: Swagger.qm.dox.h:1349
constructor(string path, hash< auto > oh, SwaggerSchema swagger)
Constructor.
This class stores the path tree for URI path matching.
Definition: Swagger.qm.dox.h:1279
*PathItemObject tryMatch(string path)
matches a URI path with a PathItemObject
PathItemObject match(string path)
matches a URI path with a PathItemObject
constructor(hash< auto > oh, SwaggerSchema swagger)
Constructor.
PathComponent paths
the tree of path components for path matching with wildcards
Definition: Swagger.qm.dox.h:1284
hash< string, list< string > > getPathOperationHash()
returns a hash of URI paths as keys with values as lists of supported HTTP methods
Describes a single response from an API Operation.
Definition: Swagger.qm.dox.h:1899
*SchemaObject schema
A definition of the response structure.
Definition: Swagger.qm.dox.h:1912
string desc
Required. A short description of the response. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:1903
hash< auto > headers
A hash of headers that are (can be) sent with the response.
Definition: Swagger.qm.dox.h:1918
hash examples
A hash of example response messages.
Definition: Swagger.qm.dox.h:1928
static ResponseObject newResponse(string key, hash< auto > oh, SwaggerSchema swagger)
returns a new ResponseObject corresponding to the schema definition passed
constructor(string key, hash< auto > oh, SwaggerSchema swagger)
private constructor; use newResponse() instead
contains the possible responses for an operation
Definition: Swagger.qm.dox.h:1867
ResponseObject defaultResp
Definition: Swagger.qm.dox.h:1874
constructor(string path, string method, hash< auto > oh, SwaggerSchema swagger)
Constructor.
hash< string, ResponseObject > responses
Definition: Swagger.qm.dox.h:1881
Base used by OtherParameter, HeaderObject and SchemaObject.
Definition: Swagger.qm.dox.h:373
*bool exclusiveMin
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:386
checkArrayParam(bool serialize, bool request, SchemaObject items, string path, string method, string name, reference< softlist< auto > > value)
validates the value against the schema definition
auto getExampleValue(string type, *string format)
returns an example value for the given type
*int minItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.3.
Definition: Swagger.qm.dox.h:401
*float multipleOf
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.1.
Definition: Swagger.qm.dox.h:413
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, string v, reference< auto > value)
validates string values
constructor(string objType, hash< auto > oh)
Constructor.
*int maxItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.2.
Definition: Swagger.qm.dox.h:398
*int minLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.2.
Definition: Swagger.qm.dox.h:392
static throwInvalidType(string name, string actual, string expected, auto value)
throws an SCHEMA-VALIDATION-ERROR exception
*float maximum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:377
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, binary v, reference value)
converts binary values to strings for supported formats
constructor(SchemaBase other)
Copy constructor.
*int maxLength
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.1.
Definition: Swagger.qm.dox.h:389
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, date v, reference value)
converts strings to/from date/time values for supported formats
*bool exclusiveMax
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2.
Definition: Swagger.qm.dox.h:383
*bool uniqueItems
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.4.
Definition: Swagger.qm.dox.h:404
static bool checkValueType(reference< auto > value, string type)
Checks the value against the type.
*float minimum
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.3.
Definition: Swagger.qm.dox.h:380
check(bool serialize, bool request, string type, *string format, *SchemaObject items, string path, string method, string name, reference< auto > value)
validates the value against the schema definition
*string pattern
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.
Definition: Swagger.qm.dox.h:395
defines an object in a schema
Definition: Swagger.qm.dox.h:2042
auto additionalProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4.
Definition: Swagger.qm.dox.h:2093
bool readOnly
Relevant only for Schema "properties" definitions. Declares the property as "read only".
Definition: Swagger.qm.dox.h:2130
bool nullable
extension that allows types to be nullable
Definition: Swagger.qm.dox.h:2079
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:2086
*string format
The extending format for the previously mentioned type. See Data Type Formats for further details.
Definition: Swagger.qm.dox.h:2056
static SchemaObject newSchemaObject(string name, auto error, SwaggerSchema swagger)
throws an "INVALID-FIELD-TYPE" exception
static SchemaObject newSchemaObject(string name, hash< auto > oh, SwaggerSchema swagger, *bool require_items)
returns a SchemaObject for the schema definition; resolves references
check(bool serialize, bool request, string path, string method, string name, reference< auto > value)
validates the value against the schema definition
constructor(string name, hash< auto > oh, SwaggerSchema swagger, *string hash_str, *bool require_items)
private constructor; use newSchemaObject() instead
list< SchemaObject > allOf()
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.3.
*int maxProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.1.
Definition: Swagger.qm.dox.h:2071
string name
the name of this object for documentation and example purposes
Definition: Swagger.qm.dox.h:2046
string type
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.2.
Definition: Swagger.qm.dox.h:2053
*string discriminator
Adds support for polymorphism.
Definition: Swagger.qm.dox.h:2120
*SchemaObject items
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.3.1.
Definition: Swagger.qm.dox.h:2065
*XmlObject xml
This MAY be used only on properties schemas. It has no effect on root schemas.
Definition: Swagger.qm.dox.h:2151
string getQoreExample(reference< hash< RestQoreExampleCodeInfo > > rv, string name, bool decl)
returns example Qore code for the object
*ExternalDocumentationObject externalDocs
Additional external documentation for this schema.
Definition: Swagger.qm.dox.h:2154
const ScalarTypes
valid scalar types
Definition: Swagger.qm.dox.h:2160
static checkValueType(reference< auto > value, string type, *SchemaObject items, *string loc)
validates default values
*string desc
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:2062
auto defaultVal
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.
Definition: Swagger.qm.dox.h:2068
*string title
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.1.
Definition: Swagger.qm.dox.h:2059
checkIntern(bool serialize, bool request, string type, *string format, string path, string method, string name, hash< auto > v, reference< hash< auto > > value)
validates a schema object against a value
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:2099
auto example
A free-form property to include an example of an instance for this schema.
Definition: Swagger.qm.dox.h:2157
const ReferenceTypes
valid reference types
Definition: Swagger.qm.dox.h:2164
*int minProperties
See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.2.
Definition: Swagger.qm.dox.h:2074
Lists the available scopes for an OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2411
constructor(hash< auto > oh)
Constructor.
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:2418
Allows the definition of a security scheme that can be used by the operations.
Definition: Swagger.qm.dox.h:2345
*string flow
The flow used by the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2372
*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:2378
string type
Required. The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
Definition: Swagger.qm.dox.h:2349
*string inLoc
The location of the API key. Valid values are "query" or "header".
Definition: Swagger.qm.dox.h:2364
constructor(hash< auto > oh)
Constructor.
*string name
The name of the header or query parameter to be used.
Definition: Swagger.qm.dox.h:2358
*ScopesObject scopes
The available scopes for the OAuth2 security scheme.
Definition: Swagger.qm.dox.h:2394
*string desc
A short description for security scheme.
Definition: Swagger.qm.dox.h:2352
*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:2384
Used for loading the Swagger definitions.
Definition: Swagger.qm.dox.h:520
static string detectSourceEncoding(string str)
tries to determine the Swagger schema source encoding automatically
static SwaggerSchema fromString(string swaggerSpecification, *bool json, *hash< auto > opts)
Load Swagger definition from a string.
static hash< auto > parseSchemaSource(string str, string ser)
parses the source encoding from the given string
static hash< auto > parseSchemaContent(string filepath, string str)
Load a schema definition from a file.
static SwaggerSchema fromUrl(string url, *bool json, *hash< auto > opts)
Load Swagger definition from a URL or file path.
static SwaggerSchema fromFile(string filepath, *hash< auto > opts)
Load Swagger definition from a file.
This is the root document object for the API specification. It combines what previously was the Resou...
Definition: Swagger.qm.dox.h:603
hash< RestQoreExampleCodeInfo > getQoreExampleResponseImpl(string method, string path, int code)
returns example Qore code for the given response
hash< HttpResponseInfo > processResponseImpl(string method, string path, int code, auto response_body, *hash< auto > headers, *softlist< string > content_types)
processes a REST response with a serialized message body, validates any response data against schema ...
AbstractDataProvider getDataProviderImpl(HTTPClient rest)
returns a data provider object for this connection
setTimeZoneLocaleImpl(*TimeZone tz)
Allows the time zone locale to be set for serialization / deserialization.
hash< RestSchemaValidator::RestRequestServerInfo > parseRequestImpl(string method, string path, *data http_body, reference< hash > headers)
processes and parses a client request and returns the deserialized message body (if any)
bool checkResponseTextPlain(reference< hash< HttpResponseInfo > > resp, auto body, hash< string, bool > mime_types, *list< auto > content_types)
Check if the response body can be sent as text/plain and if so, modify the response hash.
hash< string, bool > produces
A set of MIME types (strings) the APIs can produce.
Definition: Swagger.qm.dox.h:656
hash< RestQoreExampleCodeInfo > getQoreExampleRequestImpl(string method, string path)
returns example Qore code for the given request
string getTargetUrlImpl()
returns the target URL for the schema
setBasePathImpl(string basePath)
overrides the basePath value
hash< string, SchemaObject > definitions()
An object to hold data types produced and consumed by operations.
bool checkResponseContentTypeHeader(reference< hash< HttpResponseInfo > > resp, auto body, *hash< auto > headers)
Check if the headers contain a content-type header and if so, modify the response hash.
hash< string, hash< string, SchemaObject > > so_map
maps name -> SHA1 hash of the config -> schema objects for recursive references
Definition: Swagger.qm.dox.h:734
hash< string, list< string > > getPathOperationHashImpl()
returns a hash of URI paths as keys with values as lists of supported HTTP methods
*hash< auto > source_definition_hash
the raw parsed definitions; used for resolving out-of-order references
Definition: Swagger.qm.dox.h:740
*string def_path
the default path to use when retrieving external schema references
Definition: Swagger.qm.dox.h:720
hash< HttpResponseInfo > processResponseIntern(string method, string path, int code, auto response_body, *hash< auto > headers, *softlist< string > content_types, bool compact_serialization)
processes a REST response with a serialized message body, validates any response data against schema ...
hash< string, softlist< string > > security
A declaration of which security schemes are applied for the API as a whole.
Definition: Swagger.qm.dox.h:694
hash< string, ResponseObject > responses
Response definitions that can be used across operations. This property does not define global respons...
Definition: Swagger.qm.dox.h:674
*ExternalDocumentationObject externalDocs
Additional external documentation.
Definition: Swagger.qm.dox.h:709
constructor(LoggerInterface logger, string schema_source, hash< auto > oh, *hash< auto > opts)
Builds the schema representation from the deserialized schema hash describing the root document objec...
hash< RestSchemaValidator::RestExampleRequestInfo > getExampleRequestImpl(string method, string path, *softlist< string > content_types)
returns a hash of example message information for the given request
string getBasePathImpl()
returns the base path prefix for all requests in this schema
ResponseObject resolveResponse(string name, string refstr, hash< auto > oh)
resolves a reference to a response
AbstractParameterObject resolveParameter(string name, string refstr, hash< auto > oh)
resolves a reference to a parameter
hash< RestSchemaValidator::RestRequestClientInfo > processRequestIntern(string method, string path, auto body, *hash< auto > headers, *softlist< string > content_types, bool compact_serialization)
processes a client-side REST request and returns a hash that can be used to make the outgoing client-...
bool checkRequestContentTypeHeader(reference< hash< RestRequestClientInfo > > req, auto body, *hash< auto > headers)
Check if the headers contain a content-type header and if so, modify the request hash.
*code try_import
a call reference or closure to be passed a string name for external schema references
Definition: Swagger.qm.dox.h:725
*string basePath
The base path on which the API is served, which is relative to the host.
Definition: Swagger.qm.dox.h:634
constructorIntern(string schema_source, hash< auto > oh, *hash< auto > opts)
common constructor implementation
string hash_str
the hash for the schema
Definition: Swagger.qm.dox.h:728
hash< string, SecuritySchemeObject > securityDefinitions
Security scheme definitions that can be used across the specification.
Definition: Swagger.qm.dox.h:680
ParameterItemsSchemaObject resolveParameterItemsSchemaObject(string name, string refstr, hash< auto > oh)
resolves a reference to a parameter items schema object
*int opt_flags
parse option flags
Definition: Swagger.qm.dox.h:731
SchemaObject processDefinition(string key, auto value)
Processes a schema definition.
string swaggerSpec
Swagger Specification version being used.
Definition: Swagger.qm.dox.h:611
SchemaObject resolveSchemaObject(string name, string refstr, hash< auto > oh)
resolves a reference to a schema object
*TimeZone getTimeZoneLocaleImpl()
Returns the time zone locale used for serialization / deserialization.
InfoObject info
Required. Provides metadata about the API. The metadata can be used by the clients if needed.
Definition: Swagger.qm.dox.h:614
string getHashImpl()
returns a unique hash for the schema that can be used to compare schemas
hash< auto > getExternalReference(string refstr)
retrieves external references
bool compact_serialization
if serialized data should be subject to compact serialization (default: True)
Definition: Swagger.qm.dox.h:717
const SwaggerOptions
SwaggerSchema options.
Definition: Swagger.qm.dox.h:712
fixPath(reference< string > path)
removes the base path from the beginning of the path, if present
constructor(string schema_source, hash< auto > oh, *hash< auto > opts)
Builds the schema representation from the deserialized schema hash describing the root document objec...
hash< RestExampleResponseInfo > getExampleResponseImpl(string method, string path, int code, *softlist< string > content_types)
returns a hash of example message information for the given request
*string host
The host (name or IP) serving the API.
Definition: Swagger.qm.dox.h:626
hash< RestSchemaValidator::RestResponseClientInfo > parseResponseImpl(string method, string path, int code, *data response_body, hash< auto > hdr)
parses and validates the response from the server and returns a hash of the processed info
hash< string, bool > consumes
A set of MIME types (strings) the APIs can consume.
Definition: Swagger.qm.dox.h:649
hash< string, bool > schemes
The transfer protocol of the API.
Definition: Swagger.qm.dox.h:642
PathsObject paths
Required. The available paths and operations for the API.
Definition: Swagger.qm.dox.h:617
list< TagObject > tags
A list of tags used by the specification with additional metadata.
Definition: Swagger.qm.dox.h:706
hash< RestSchemaValidator::RestRequestClientInfo > processRequestImpl(string method, string path, auto body, *hash< auto > headers, *softlist< string > content_types)
processes a client-side REST request and returns a hash that can be used to make the outgoing client-...
hash< string, AbstractParameterObject > parameters()
Parameter definitions that can be used across operations. This property does not define global parame...
Allows adding metadata to a single tag that is used by the OperationObject. It is not mandatory to ha...
Definition: Swagger.qm.dox.h:2018
*ExternalDocumentationObject externalDocs
Additional external documentation for this tag.
Definition: Swagger.qm.dox.h:2028
*string desc
A short description for the tag. GFM syntax can be used for rich text representation.
Definition: Swagger.qm.dox.h:2025
string name
Required. The name of the tag.
Definition: Swagger.qm.dox.h:2022
constructor(hash< auto > oh)
Constructor.
A metadata object that allows for more fine-tuned XML model definitions.
Definition: Swagger.qm.dox.h:2300
bool wrapped
MAY be used only for an array definition. Signifies whether the array is wrapped (for example,...
Definition: Swagger.qm.dox.h:2327
*string name
Replaces the name of the element/attribute used for the described schema property.
Definition: Swagger.qm.dox.h:2311
bool attribute
Declares whether the property definition translates to an attribute instead of an element....
Definition: Swagger.qm.dox.h:2320
constructor(hash< auto > oh)
Constructor.
*string prefix
The prefix to be used for the name.
Definition: Swagger.qm.dox.h:2317
*string ns
The URL of the namespace definition. Value SHOULD be in the form of a URL.
Definition: Swagger.qm.dox.h:2314
const LM_IGNORE_INVALID_REQUIRED
parse option: ignore invalid "required" properties
Definition: Swagger.qm.dox.h:251
const LM_ALL
parse options: all options
Definition: Swagger.qm.dox.h:260
const LM_ACCEPT_INVALID_BODY_PARAMS
parse option: reconstruct invalid body parameters
Definition: Swagger.qm.dox.h:254
const LM_AUTO_FORM_DATA
parse option: add consumes application/x-www-form-urlencoded to API endpoint if formData is used in p...
Definition: Swagger.qm.dox.h:257
const LM_LAX_COLLECTIONFORMAT
parse option: allow collectionFormat on non-array types
Definition: Swagger.qm.dox.h:248
const LM_IGNORE_MISSING_REQUIRED
Definition: Swagger.qm.dox.h:245
main namespace for all public Swagger declarations
Definition: Swagger.qm.dox.h:239
const CollectionFormats
allowed collection formats
Definition: Swagger.qm.dox.h:272
const ValidNumberFormats
Valid number type formats.
Definition: Swagger.qm.dox.h:267
const ValidStringFormatsHash
A hash of valid string type formats.
Definition: Swagger.qm.dox.h:284
const ValidNumberFormatsHash
A hash of valid number type formats.
Definition: Swagger.qm.dox.h:282
const ParameterCollectionFormats
valid parameter collection formats
Definition: Swagger.qm.dox.h:276
const SerializationModules
modules available for data serialization and/or deserialization
Definition: Swagger.qm.dox.h:330
const ValidStringFormats
Valid string type formats.
Definition: Swagger.qm.dox.h:269
const ValidIntFormatsHash
A hash of valid integer type formats.
Definition: Swagger.qm.dox.h:280
const MimeDataTypes
supported mime types for de/serializing data
Definition: Swagger.qm.dox.h:295
const MimeContentTypes
MIME types for data serialization.
Definition: Swagger.qm.dox.h:333
const ValidIntFormats
Valid integer type formats.
Definition: Swagger.qm.dox.h:265
const YamlSerialization
Yaml serialization.
Definition: Swagger.qm.dox.h:287
const ValidSchemes
Valid transfer protocol schemes.
Definition: Swagger.qm.dox.h:336