121 hash<string, string> hashdecls();
136 string getTargetUrl();
150 hash<RestRequestClientInfo> processRequest(
string method,
string path,
auto body, *
hash headers, *softlist<string> content_types);
165 hash<RestRequestServerInfo> parseRequest(
string method,
string path, *data http_body, reference<hash> headers);
184 hash<HttpResponseInfo> processResponse(
string method,
string path,
int code,
auto response_body, *
hash headers, *softlist<string> content_types);
196 hash<RestResponseClientInfo> parseResponse(
string method,
string path,
int code, *data response_body,
hash hdr);
205 hash<RestQoreExampleCodeInfo> getQoreExampleRequest(
string method,
string path);
215 hash<RestExampleRequestInfo> getExampleRequest(
string method,
string path, *softlist<string> content_types);
225 hash<RestQoreExampleCodeInfo> getQoreExampleResponse(
string method,
string path,
int code);
236 hash<RestExampleResponseInfo> getExampleResponse(
string method,
string path,
int code, *softlist<string> content_types);
242 hash<string, list<string>> getPathOperationHash();
248 string getBasePath();
254 setBasePath(
string basePath);
264 abstract string getTargetUrlImpl();
280 abstract hash<RestRequestClientInfo> processRequestImpl(
string method,
string path,
auto body, *
hash headers, *softlist<string> content_types);
297 abstract hash<RestRequestServerInfo> parseRequestImpl(
string method,
string path, *data http_body, reference<hash> headers);
318 abstract hash<HttpResponseInfo> processResponseImpl(
string method,
string path,
int code, any response_body, *
hash headers, *softlist<string> content_types);
332 abstract hash<RestResponseClientInfo> parseResponseImpl(
string method,
string path,
int code, *data response_body,
hash hdr);
340 abstract hash<string, list<string>> getPathOperationHashImpl();
348 abstract string getBasePathImpl();
356 abstract setBasePathImpl(
string basePath);
367 abstract hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(
string method,
string path);
379 abstract hash<RestExampleRequestInfo> getExampleRequestImpl(
string method,
string path, *softlist<string> content_types);
391 abstract hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(
string method,
string path,
int code);
404 abstract hash<RestExampleResponseInfo> getExampleResponseImpl(
string method,
string path,
int code, *softlist<string> content_types);
414 const DataSerializationSupport = {
415 MimeTypeJson: \make_json(),
416 MimeTypeYamlRpc: \make_yaml(),
417 MimeTypeYaml: \make_yaml(),
418 MimeTypeXml: \make_xmlrpc_value(),
421 MimeTypeFormUrlEncoded;
426 const DataSerializationSupportList = keys DataSerializationSupport;
428 const DeserializeYaml = (
432 const DeserializeXml = (
435 "in":
auto (
string xml, reference<string>
type) {
437 on_success
type =
"xml";
438 return parse_xmlrpc_value(xml);
440 catch (hash<ExceptionInfo> ex);
446 const DataDeserializationSupport = {
447 MimeTypeFormUrlEncoded: (
449 "in": \mime_parse_form_urlencoded_string(),
455 MimeTypeYamlRpc: DeserializeYaml,
456 MimeTypeYaml: DeserializeYaml,
457 MimeTypeXml: DeserializeXml,
458 MimeTypeXmlApp: DeserializeXml,
461 "in":
string (
string s) {
return s; },
475 string getTargetUrlImpl();
492 hash<RestRequestClientInfo> processRequestImpl(
string method,
string path,
auto body, *
hash headers, *softlist<string> content_types);
510 hash<RestRequestServerInfo> parseRequestImpl(
string method,
string path, *data http_body, reference<hash> headers);
532 hash<HttpResponseInfo> processResponseImpl(
string method,
string path,
int code,
auto response_body, *
hash headers, *softlist<string> content_types);
547 hash<RestResponseClientInfo> parseResponseImpl(
string method,
string path,
int code, *data response_body,
hash hdr);
556 hash<string, list<string>> getPathOperationHashImpl();
565 string getBasePathImpl();
572 setBasePathImpl(
string basePath);
583 hash<RestQoreExampleCodeInfo> getQoreExampleRequestImpl(
string method,
string path);
596 hash<RestExampleRequestInfo> getExampleRequestImpl(
string method,
string path, *softlist<string> content_types);
609 hash<RestQoreExampleCodeInfo> getQoreExampleResponseImpl(
string method,
string path,
int code);
623 hash<RestExampleResponseInfo> getExampleResponseImpl(
string method,
string path,
int code, *softlist<string> content_types);
string response_uri
the HTTP response URI
Definition: RestSchemaValidator.qm.dox.h:109
hash info
miscellaneous free-form info about the parsed request
Definition: RestSchemaValidator.qm.dox.h:81
string body
the HTTP request body
Definition: RestSchemaValidator.qm.dox.h:103
string sprintf(string fmt,...)
main namespace for all public RestSchemaValidator declarations
Definition: RestSchemaValidator.qm.dox.h:61
a hash giving example info for example HTTP request messages
Definition: RestSchemaValidator.qm.dox.h:97
abstract REST schema validation classes
Definition: RestSchemaValidator.qm.dox.h:128
hash hdr
the HTTP response header hash
Definition: RestSchemaValidator.qm.dox.h:113
a hash of information about a response from the server
Definition: RestSchemaValidator.qm.dox.h:85
string example
a string giving the example code generation
Definition: RestSchemaValidator.qm.dox.h:124
a hash of information about a client-side request
Definition: RestSchemaValidator.qm.dox.h:63
hash hdr
the HTTP headers received
Definition: RestSchemaValidator.qm.dox.h:91
auto body
the deserialized message body data
Definition: RestSchemaValidator.qm.dox.h:79
string content
the Content-Type for the message
Definition: RestSchemaValidator.qm.dox.h:67
a hash giving example information for building a request or response in Qore
Definition: RestSchemaValidator.qm.dox.h:119
int code
the HTTP status code
Definition: RestSchemaValidator.qm.dox.h:111
null REST validator; no schema is used but default serialization and deserialization is performed ...
Definition: RestSchemaValidator.qm.dox.h:409
hash info
miscellaneous free-form info about the parsed response
Definition: RestSchemaValidator.qm.dox.h:93
a hash of information about a server-side request
Definition: RestSchemaValidator.qm.dox.h:73
a hash giving example info for example HTTP response messages
Definition: RestSchemaValidator.qm.dox.h:107
string request_uri
the HTTP request URI
Definition: RestSchemaValidator.qm.dox.h:99
int code
the HTTP status code
Definition: RestSchemaValidator.qm.dox.h:87
string body
the HTTP response body
Definition: RestSchemaValidator.qm.dox.h:115
string string(softstring str, *string enc)
hash hdr
the HTTP request header hash
Definition: RestSchemaValidator.qm.dox.h:101
auto body
the deserialized message body
Definition: RestSchemaValidator.qm.dox.h:89
string path
the URI path without query arguments
Definition: RestSchemaValidator.qm.dox.h:75
*hash query
any query arguments
Definition: RestSchemaValidator.qm.dox.h:77
string uri_path
the URI path for the request
Definition: RestSchemaValidator.qm.dox.h:65
*data body
the serialized message body hash
Definition: RestSchemaValidator.qm.dox.h:69