oiime / openrtb-schema-validator Goto Github PK
View Code? Open in Web Editor NEWthin layer on top of ajv that validates openrtb requests and responses
License: MIT License
thin layer on top of ajv that validates openrtb requests and responses
License: MIT License
The ORTB Native specs 1.1 allows direct JSON or JSON-encoded string
https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-Native-Ads-Specification-1-1_2016.pdf
But if I pass native request as JSON object, validation fails.
Request eg.
{ "ext": {}, "cur": [], "allimps": 0, "test": 0, "regs": { "ext": { "gdpr": 0 } }, "source": {}, "imp": [ { "iframebuster": [], "ext": { "siteid": null }, "pmp": { "ext": {}, "private_auction": 0, "deals": [] }, "native": { "ext": {}, "request": { "native": { "ext": {}, "plcmtcnt": 1, "ver": "1.1", "assets": [ { "img": { "h": 627, "hmin": 72, "type": 3, "wmin": 137, "w": 1200 }, "required": 1, "id": 401 }, { "data": { "type": 1 }, "required": 1, "id": 501 }, { "data": { "type": 11 }, "required": 1, "id": 502 }, { "title": { "len": 75 }, "required": 1, "id": 601 } ], "context": 1, "plcmttype": 1, "contextsubtype": 10 } }, "battr": [], "ver": "1.1", "api": [] }, "tagid": "", "metric ": [], "bidfloor": 0, "bidfloorcur": "USD", "id": "1", "secure": 1, "instl": 0 } ], "bapp": [], "site": { "id": "dHP", "sectioncat": [], "ext": {}, "keywords": "", "cat": [], "domain": "msn.com", "publisher": { "ext": {}, "id": "1111", "cat": [] }, "page": "https://www.test.com", "pagecat": [], "content": { "ext": {}, "producer": { "ext": {}, "cat": [] }, "data": [], "cat": [] } }, "at": 1, "bcat": [ "IAB25-3", "IAB25-2", "IAB25-1", "IAB26", "IAB25-5", "IAB25-4" ], "wlang": [], "id": "999999999999999999999", "bseat": {}, "user": { "ext": {}, "geo": { "ext": {} }, "id": "9999999999999999", "data": [] }, "device": { "ext": {}, "geo": { "ext": {} }, "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36", "ip": "1.1.1.1" }, "wseat": [], "badv": ["testing.com"] }
The https://json-schema.org/ is a good way to validate a JSOn struct.
Here you may find ready to use schemas for OpenRTB
https://github.com/stokito/openssp/tree/master/open-ssp-parent/open-ssp-openrtb-validator/src/main/resources/schemas
Maybe instead of a custom code you may use it?
RemoveAdditional: false throws additional properties error if request contains extra properties.
Is there an option to ignore Additional properties while validating schema?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.