{"id":948,"date":"2020-12-09T01:00:51","date_gmt":"2020-12-09T01:00:51","guid":{"rendered":"https:\/\/smartdatamodels.org\/?page_id=948"},"modified":"2021-05-13T12:36:17","modified_gmt":"2021-05-13T10:36:17","slug":"check-a-schema-validates-a-payload","status":"publish","type":"page","link":"https:\/\/smartdatamodels.org\/index.php\/check-a-schema-validates-a-payload\/","title":{"rendered":"Check a schema validates a payload"},"content":{"rendered":"<div class=\"entry-content\">\n<h4>Although the service keeps being operative we recommend using this <a href=\"https:\/\/www.jsonschemavalidator.net\/\">https:\/\/www.jsonschemavalidator.net\/<\/a> because it provides more explanations about the errors.<\/h4>\n<p>If you want to check if a schema validates a payload\u00a0 through this API call<\/p>\n<p><strong>Call: https:\/\/smartdatamodels.org\/extra\/validate_payload.php<\/strong><\/p>\n<p><strong>Parameters<\/strong>: (Mandatories)<\/p>\n<ul>\n<li>payloadUrl: The url of the payload in RAW version<\/li>\n<li>schemaUrl: The link to the <strong>RAW<\/strong> version of the json schema (see example)<\/li>\n<\/ul>\n<p>Example: <a href=\"https:\/\/smartdatamodels.org\/extra\/validate_payload.php?payloadUrl=https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Battery\/master\/Battery\/examples\/example.json&amp;schemaUrl=https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Battery\/master\/Battery\/schema.json\">https:\/\/smartdatamodels.org\/extra\/validate_payload.php?payloadUrl=https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Battery\/master\/Battery\/examples\/example.json&amp;schemaUrl=https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Battery\/master\/Battery\/schema.json<\/a><\/p>\n<p><strong>Output<\/strong>: A json payload with these properties<\/p>\n<ul>\n<li>result: Boolean. if the schema validates the payload.<\/li>\n<li>time: time stamp in ISO 8601 (CET) of the validation<\/li>\n<li>payloadUrl: The url of the payload in RAW version submitted<\/li>\n<li>schemaUrl: The link to the <strong>RAW<\/strong> version of the json schema submitted<\/li>\n<\/ul>\n<p>on error<\/p>\n<ul>\n<li>cause: The description of the cause for the rejection to the validation<\/li>\n<\/ul>\n\n<div class=\"wpcf7 no-js\" id=\"wpcf7-f1018-o1\" lang=\"en-US\" dir=\"ltr\" data-wpcf7-id=\"1018\">\n<div class=\"screen-reader-response\"><p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"><\/p> <ul><\/ul><\/div>\n<form action=\"\/index.php\/wp-json\/wp\/v2\/pages\/948#wpcf7-f1018-o1\" method=\"post\" class=\"wpcf7-form init\" aria-label=\"Contact form\" novalidate=\"novalidate\" data-status=\"init\">\n<fieldset class=\"hidden-fields-container\"><input type=\"hidden\" name=\"_wpcf7\" value=\"1018\" \/><input type=\"hidden\" name=\"_wpcf7_version\" value=\"6.1.5\" \/><input type=\"hidden\" name=\"_wpcf7_locale\" value=\"en_US\" \/><input type=\"hidden\" name=\"_wpcf7_unit_tag\" value=\"wpcf7-f1018-o1\" \/><input type=\"hidden\" name=\"_wpcf7_container_post\" value=\"0\" \/><input type=\"hidden\" name=\"_wpcf7_posted_data_hash\" value=\"\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_group_fields\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_hidden_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_visible_groups\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_repeaters\" value=\"[]\" \/><input type=\"hidden\" name=\"_wpcf7cf_steps\" value=\"{}\" \/><input type=\"hidden\" name=\"_wpcf7cf_options\" value=\"{&quot;form_id&quot;:1018,&quot;conditions&quot;:[],&quot;settings&quot;:{&quot;animation&quot;:&quot;yes&quot;,&quot;animation_intime&quot;:&quot;200&quot;,&quot;animation_outtime&quot;:&quot;200&quot;,&quot;conditions_ui&quot;:&quot;normal&quot;,&quot;notice_dismissed&quot;:&quot;true&quot;,&quot;notice_dismissed_rollback-cf7-5.9.4&quot;:true,&quot;notice_dismissed_rollback-cf7-5.9.5&quot;:true,&quot;notice_dismissed_rollback-cf7-6.1.4&quot;:true}}\" \/><input type=\"hidden\" name=\"redirect_nonce\" value=\"95563195da\" \/><input type=\"hidden\" name=\"wpcf7cfpdf_hidden_name\" value=\"document-pdf\" \/><input type=\"hidden\" name=\"wpcf7cfpdf_hidden_reference\" value=\"b3abcfaf\" \/><input type=\"hidden\" name=\"wpcf7cfpdf_hidden_date\" value=\"04272026\" \/><input type=\"hidden\" name=\"_wpcf7_recaptcha_response\" value=\"\" \/>\n<\/fieldset>\n<div class=\"divTable\" style=\"border: 0px solid #000;\">\n\t<div class=\"divTableBody\">\n\t\t<div class=\"divTableRow\">\n\t\t\t<div class=\"divTableCell\">\n\t\t\t\t<p>This form validates a payload against a data model\n\t\t\t\t<\/p>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<div class=\"divTableRow\">\n\t\t\t<div class=\"divTableCell\">\n\t\t\t\t<p><label> URL SCHEMA<br \/>\n<span class=\"wpcf7-form-control-wrap\" data-name=\"schemaUrl\"><input size=\"40\" maxlength=\"400\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" value=\"\" type=\"text\" name=\"schemaUrl\" \/><\/span><br \/>\nUrl of the schema (raw version please) <\/label>\n\t\t\t\t<\/p>\n\t\t\t<\/div>\n\t\t\t<div class=\"divTableCell\">\n\t\t\t\t<p><label> URL PAYLOAD<br \/>\n<span class=\"wpcf7-form-control-wrap\" data-name=\"payloadUrl\"><input size=\"40\" maxlength=\"400\" class=\"wpcf7-form-control wpcf7-text wpcf7-validates-as-required\" aria-required=\"true\" aria-invalid=\"false\" value=\"\" type=\"text\" name=\"payloadUrl\" \/><\/span><br \/>\nUrl of the schema (raw version please) <\/label>\n\t\t\t\t<\/p>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<div class=\"divTableRow\">\n\t\t\t<div class=\"divTableCell\">\n\t\t\t<\/div>\n\t\t\t<div class=\"divTableCell\">\n\t\t\t\t<p>&nbsp;\n\t\t\t\t<\/p>\n\t\t\t<\/div>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n<!-- DivTable.com -->\n<p><span class=\"wpcf7-form-control-wrap wpgdprc\"><span class=\"wpcf7-form-control wpcf7-wpgdprc wpcf7-validates-as-required\"><span class=\"wpcf7-list-item\"><input type=\"checkbox\" name=\"wpgdprc\" value=\"1\" aria-required=\"true\" aria-invalid=\"false\" \/><span class=\"wpcf7-list-item-label\">By using this form you agree with the storage and handling of your data by this website.<\/span><\/span><\/span>    <\/span>\n<\/p>\n<p><input class=\"wpcf7-form-control wpcf7-submit has-spinner\" type=\"submit\" value=\"Submit\" \/><br \/>\nAfter clicking it will appear a message confirming the submission\n<\/p>\n<p>It will take a while to redirect to the feedback on a specific page\n<\/p>\n<p><B>Thanks for being patient<\/b>\n<\/p><p style=\"display: none !important;\" class=\"akismet-fields-container\" data-prefix=\"_wpcf7_ak_\"><label>&#916;<textarea name=\"_wpcf7_ak_hp_textarea\" cols=\"45\" rows=\"8\" maxlength=\"100\"><\/textarea><\/label><input type=\"hidden\" id=\"ak_js_1\" name=\"_wpcf7_ak_js\" value=\"74\"\/><script type=\"text\/javascript\">\n\/* <![CDATA[ *\/\ndocument.getElementById( \"ak_js_1\" ).setAttribute( \"value\", ( new Date() ).getTime() );\n\/* ]]> *\/\n<\/script>\n<\/p><div class=\"wpcf7-response-output\" aria-hidden=\"true\"><\/div>\n<\/form>\n<\/div>\n\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Although the service keeps being operative we recommend using this https:\/\/www.jsonschemavalidator.net\/ because it provides more explanations about the errors. If you want to check if a schema validates a payload\u00a0 through this API call Call: https:\/\/smartdatamodels.org\/extra\/validate_payload.php Parameters: (Mandatories) payloadUrl: The url of the payload in RAW version schemaUrl: The link&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/smartdatamodels.org\/index.php\/check-a-schema-validates-a-payload\/\">More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-948","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1829,"url":"https:\/\/smartdatamodels.org\/index.php\/generate-a-ngsi-ld-payload-based-on-a-smart-data-model\/","url_meta":{"origin":948,"position":0},"title":"Generate a NGSI-LD normalized payload based on a Smart Data Model","author":"maestro","date":"02\/03\/2021","format":false,"excerpt":"This is an alpha version (so you can expect errors and not being complete). Use it at your own risk. Please report them at info@smartdatamodels.org Call: https:\/\/smartdatamodels.org\/extra\/ngsi-ld_generator.php Parameters: (Mandatories) schemaUrl: The link to the RAW version of the json schema (see example) email: your email Example: https:\/\/smartdatamodels.org\/extra\/ngsi-ld_generator.php?schemaUrl=https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Streetlighting\/f56f5a7933ab05d7fce1d5adc0847f25a099cdb4\/StreetlightModel\/schema.json&email=alberto.abella@fiware.org Use any data\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2199,"url":"https:\/\/smartdatamodels.org\/index.php\/generate-a-ngsi-ld-keyvalues-payload-compliant-with-a-data-model\/","url_meta":{"origin":948,"position":1},"title":"Generate a NGSI-LD keyvalues payload compliant with a data model","author":"maestro","date":"28\/04\/2021","format":false,"excerpt":"This is an alpha version (so you can expect errors and not being complete). Use it at your own risk. Please report them at info@smartdatamodels.org Call: https:\/\/smartdatamodels.org\/extra\/ngsi-ld_generator_keyvalues_v0.95.php Parameters: (Mandatories) schemaUrl: The link to the RAW version of the json schema (see example) email: your email Example: https:\/\/smartdatamodels.org\/extra\/ngsi-ld_generator_keyvalues_v0.95.php?schemaUrl=https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Streetlighting\/f56f5a7933ab05d7fce1d5adc0847f25a099cdb4\/StreetlightModel\/schema.json&email=alberto.abella@fiware.org Use any data\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2549,"url":"https:\/\/smartdatamodels.org\/index.php\/generate-a-geojson-feature-format-payload-based-on-a-smart-data-model\/","url_meta":{"origin":948,"position":2},"title":"Generate a Geojson feature format payload based on a Smart Data Model","author":"maestro","date":"31\/05\/2021","format":false,"excerpt":"This is a beta version (so you can expect errors and not being complete). Use it at your own risk. Please report them at info@smartdatamodels.org Call: https:\/\/smartdatamodels.org\/extra\/geojson_features_generator_v1.0.php Parameters: (Mandatories) schemaUrl: The link to the RAW version of the json schema (see example) email: your email Example: https:\/\/smartdatamodels.org\/extra\/geojson_features_generator_v1.0.php?schemaUrl=https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Streetlighting\/f56f5a7933ab05d7fce1d5adc0847f25a099cdb4\/StreetlightModel\/schema.json&email=alberto.abella@fiware.org Use any data\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4017,"url":"https:\/\/smartdatamodels.org\/index.php\/create-your-json-schema-from-a-csv-payload\/","url_meta":{"origin":948,"position":3},"title":"Create your json schema from a csv payload","author":"maestro","date":"30\/03\/2022","format":false,"excerpt":"","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3847,"url":"https:\/\/smartdatamodels.org\/index.php\/generate-you-schema-out-of-your-payload\/","url_meta":{"origin":948,"position":4},"title":"Generate you schema out of your payload","author":"maestro","date":"08\/03\/2022","format":false,"excerpt":"source code of this service if you want to improve it.","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2022\/11\/smart_data_models_icon.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":9800,"url":"https:\/\/smartdatamodels.org\/index.php\/sql-service\/","url_meta":{"origin":948,"position":5},"title":"SQL service","author":"maestro","date":"10\/10\/2023","format":false,"excerpt":"PostgreSQL schema generator Objective: This service generates a PostgreSQL schema script from your Smart Data Model model.yaml representation e.g to create a table, create type, etc. Example:\u00a0 Data model (raw version): model.yaml Corresponding SQL schema: schema.sql Test the service:\u00a0 \u00a0","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages\/948","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/comments?post=948"}],"version-history":[{"count":4,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages\/948\/revisions"}],"predecessor-version":[{"id":2378,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/pages\/948\/revisions\/2378"}],"wp:attachment":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/media?parent=948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}