Maswali yanayounganishwa na mwongozo · Kati Kiwango
Maswali ya Matokeo Yaliyoundwa
Jaribio la sehemu zinazohitajika kwa schema, nulls, sifa za ziada, hesabu na ukaguzi wa chanzo, kukataliwa, uchapishaji na kwa nini JSON halali bado inaweza kuwa na makosa.
Swali 1 ya 8
A JSON Schema declares a property named total. What must also be specified if every response must include it?
Hakiki kila swali8 maswali
Majibu na maelezo huonekana unapojibu maswali.
- A JSON Schema declares a property named total. What must also be specified if every response must include it?
- Set its numeric type only
- Add total to the required-field list
- Place it first in the schema file
- Give the object a longer description
- Why decide whether additional object fields are allowed?
- Any extra property always proves hallucination
- JSON syntax forbids all additional properties
- Only arrays can contain unexpected fields
- Unexpected fields can change how downstream code interprets a response
- A missing value and an explicit null have different meanings in an integration. What should the schema specify?
- Their separate allowed behavior and downstream interpretation
- Treat absence and null as the same without documentation
- Replace both with a fabricated zero
- Let every provider choose silently
- A receipt has subtotal 50 and tax 5; valid JSON reports total 550. What failed?
- JSON parsing
- The total field’s numeric type
- Factual and arithmetic validation against the source
- The existence of an object schema
- A structured result cites source_id 9, but only IDs 1 through 3 were supplied. What check catches the error?
- Check that source_id is a string
- Count the object’s top-level keys
- Accept any integer because its type is valid
- Verify that referenced identifiers actually exist in the supplied evidence
- How should an application handle a model refusal or truncated response?
- Assume every schema field was produced
- Treat it as an explicit non-success case rather than inventing required values
- Silently fill missing evidence with plausible defaults
- Ignore the boundary because JSON mode was requested
- A stored output uses schema v1 but a consumer expects v2. What should the integration do?
- Apply v2 assumptions without checking
- Remove the version field
- Reject or explicitly adapt the incompatible version
- Assume schema changes affect only formatting
- Two providers offer structured output, one constrains generation and one validates afterward. Which practice remains necessary for both?
- Check supported schema features and verify the values’ meaning
- Assume identical enforcement for every schema keyword
- Skip factual checks when output parses
- Treat post-validation as a guarantee of truth