RFC 8259 Quiz

Interoperable JSON parsing and generation

0 / 0

References

Q1: An A2A endpoint accepts only a JSON object at the top level. What does RFC 8259 imply?

Multiple Choice
**Explanation:** A: RFC 8259 permits any serialized JSON value at the top level. B: An application can narrow the valid input beyond the general JSON grammar. C: RFC 8259 defines JSON syntax and does not prohibit schema validation after parsing.

Q2: A request contains {"role":"reader","role":"admin"}. What is the safest interoperable decision?

Multiple Choice
**Explanation:** A: Object names should be unique and duplicate handling is unpredictable across implementations. B: Last-wins is common but is not the required behavior in RFC 8259. C: Member ordering does not resolve duplicate-name ambiguity and parsers expose ordering differently.

Q3: Can an A2A implementation assign meaning to the order of members in a JSON object?

Multiple Choice
**Explanation:** A: RFC 8259 notes that libraries differ on whether member ordering is visible. B: Encoding choice does not turn object-member order into an interoperable semantic contract. C: Array order is represented by element position while object-member order is not a safe dependency.

Q4: Which JSON array is valid under RFC 8259?

Multiple Choice
**Explanation:** A: RFC 8259 has no same-type requirement for array elements, so mixed values remain valid. B: Arrays may contain heterogeneous JSON values and each element follows the normal value grammar. C: The grammar permits an empty array as well as arrays with one or more elements.

Q5: A sender emits NaN as an unquoted JSON number. How should a conforming receiver classify it?

Multiple Choice
**Explanation:** A: NaN and Infinity are outside the RFC 8259 number grammar. B: IEEE 754 implementations can represent NaN but JSON syntax does not permit it. C: NaN is neither the lowercase null literal nor another JSON literal.

Q6: An agent identifier is the integer 9007199254740993 and must round-trip exactly across common runtimes. What is the better representation?

Multiple Choice
**Explanation:** A: Changing number notation does not make a value outside the exact binary64 integer range exact. B: JSON has no comment syntax and the numeric precision issue remains. C: A string avoids numeric rounding and lets the application define identifier syntax.

Q7: Which encoding rule applies to JSON exchanged between independent systems?

Multiple Choice
**Explanation:** A: RFC 8259 requires UTF-8 for JSON exchanged outside a closed ecosystem. B: Networked JSON uses UTF-8 and generators must not add a BOM. C: Member ordering carries no encoding negotiation signal.

Q8: A parser receives the member names "a\\b" and "a\u005Cb". How should equality be determined?

Multiple Choice
**Explanation:** A: Different escape spellings can encode the same string value. B: String equality does not depend on the position of the member in an object. C: RFC 8259 recommends code-unit comparison after converting the textual representation.

Q9: What should an implementation expect from a JSON string containing a lone UTF-16 surrogate?

Multiple Choice
**Explanation:** A: RFC 8259 describes differing lengths, values, and even runtime failures for such data. B: RFC 8259 does not define a universal replacement procedure. C: Encoding a lone surrogate does not turn it into a Unicode scalar value.

Q10: Where should an A2A service enforce limits on JSON size and nesting depth?

Multiple Choice
**Explanation:** A: Late checks allow hostile input to consume parser and application resources first. B: RFC 8259 permits size and depth limits, and early enforcement bounds resource use. C: Parsers may impose limits on text size and maximum nesting depth.