In RAML 1.0, object properties are required by default; a trailing ? in a property declaration (here ID? and publisher?) marks that property as optional. A valid Book instance must therefore supply title (string), author (string), year (integer), and the explicitly required ISBN (string). A JSON object containing exactly ISBN, year, title, and author with correctly typed values satisfies the type. The ? suffix is declaration syntax only — the actual JSON keys for the optional properties are ID and publisher, so keys written literally as "ID?" or "publisher?" do not match those declarations, and objects that omit required properties or contain malformed syntax (missing commas, unkeyed nested objects) are not valid input.
Community Discussion