[{"id":"openapiintermediate-001","courseId":"openapi-intermediate","domain":"document-structure","topic":"Webhooks at the document root","prompt":"Put these steps of a webhook exchange in the order they happen.","hint":"Consider what must exist before an event can ever reach a consumer.","explain":"One side prepares ahead of time, and the other reacts to something outside its control. Think about what must exist before anything can be delivered, and how the exchange ends.","source":"https://learn.openapis.org/specification/webhooks.html","interaction":{"type":"sort","items":[{"text":"The consumer registers a URL to receive requests","why":"Registration happens in advance, so the provider knows where to send events."},{"text":"An event occurs and triggers the webhook","why":"Nothing is sent until an event fires the webhook."},{"text":"The server sends a request with the event data to the registered URL","why":"Delivery follows the trigger, to the address the consumer registered."},{"text":"The consumer acknowledges receipt of the request","why":"The acknowledgment comes last, after the request has arrived."}]},"options":[],"answer":"o:abcd","explanation":"A webhook consumer registers a URL in advance; when an event triggers the webhook, the server sends the event data to that URL and the consumer acknowledges it.","concept":"A webhook consumer registers a URL in advance; when an event triggers the webhook, the server sends the event data to that URL and the consumer acknowledges it.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Webhooks push events to a URL the consumer registered, instead of relying on polling."]},{"id":"openapiintermediate-002","courseId":"openapi-intermediate","domain":"document-structure","topic":"Server variable default","prompt":"A server variable may leave out default when it declares an enum of allowed values.","hint":"Check which fields the Server Variable Object marks as required.","explain":"A server URL can hold placeholders that get filled in before a request goes out. Each placeholder has its own object, and that object can limit which values are offered.","source":"https://spec.openapis.org/oas/latest.html#server-variable-object","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"default is REQUIRED on every Server Variable Object, even one that declares an enum."},{"id":"b","text":"False","why":"default is always required, and an enum only limits which values it may take."}],"answer":"b","explanation":"In a Server Variable Object, default is required and gives the value used when none is supplied; enum is optional, and when present, default must be one of its values.","concept":"In a Server Variable Object, default is required and gives the value used when none is supplied; enum is optional, and when present, default must be one of its values.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","takeaways":["Every server variable needs a default, with or without an enum."]},{"id":"openapiintermediate-003","courseId":"openapi-intermediate","domain":"document-structure","topic":"Server override order","prompt":"The root document and one GET operation each define a servers array. Which TWO statements about how those arrays apply are correct?","hint":"Think about which level's servers list takes priority for one operation.","explain":"Several levels of a description can each carry a list of hosts, so a request needs a rule for picking one list. Consider how the spec resolves a conflict between a broad list and a narrow one.","source":"https://learn.openapis.org/specification/servers.html","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"GET /users is served from server2.com, because the operation's own list overrides the root list.","why":"When several levels define servers for one operation, the lowest level is the one taken into account."},{"id":"b","text":"A servers array can be placed at the root, on a Path Item, and on an Operation.","why":"The Server Object appears in the servers array of the root, the Path Item and the Operation."},{"id":"c","text":"GET /users is served from both hosts, because the root and operation lists are merged.","whyNot":"The lists are not merged; only the lowest level applies to that operation."},{"id":"d","text":"The root list wins, since the document root is the highest level.","whyNot":"Level height does not decide it; the lowest level that defines servers is the one used."},{"id":"e","text":"Servers in one list should each point at a different API for a clean split.","whyNot":"Servers listed together are meant to provide the same API, so the list does not separate APIs."},{"id":"f","text":"Operation-level servers only apply when the root servers list is empty.","whyNot":"An operation's list is used whenever it is present, regardless of what the root list holds."}],"answer":"ab","explanation":"When servers arrays appear at several levels for one operation, only the lowest level is used; lists are not merged, and servers can be set at the root, Path Item and Operation levels.","concept":"When servers arrays appear at several levels for one operation, only the lowest level is used; lists are not merged, and servers can be set at the root, Path Item and Operation levels.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","code":"servers:\n  - url: https://server1.com\npaths:\n  /users:\n    get:\n      servers:\n        - url: https://server2.com","takeaways":["The nearest servers list wins; lists at different levels are not combined."]},{"id":"openapiintermediate-004","courseId":"openapi-intermediate","domain":"document-structure","topic":"Server URL excludes query and fragment","prompt":"An OpenAPI document has no servers field, and its $self field names https://api.example.com/foo. Which base do its endpoint paths assume?","hint":"Consider what a base could be taken from when no server is written down.","explain":"Endpoint paths are relative references, which become addresses only once resolved against a base URI. Consider which base remains when a document names no server.","source":"https://spec.openapis.org/oas/latest.html#server-object","interaction":{"type":"single"},"options":[{"id":"a","text":"The location where the OpenAPI description is being served","why":"With no servers listed, endpoints are assumed to be relative to where the description is served."},{"id":"b","text":"A default host of https://localhost, chosen by the parser","whyNot":"No host is invented; the endpoints are assumed relative to the location where the description is served."},{"id":"c","text":"Each endpoint must carry its own absolute URL, so none are assumed","whyNot":"Relative endpoints are exactly what the no-servers case assumes."},{"id":"d","text":"Nothing: the parser reports an error when servers is missing","whyNot":"The servers field is optional, and the endpoints are still resolved against the served location."}],"answer":"a","explanation":"With no servers field, the spec assumes endpoints are relative to the location where the OpenAPI description is being served.","concept":"With no servers field, the spec assumes endpoints are relative to the location where the OpenAPI description is being served.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","code":"openapi: 3.2.0\n$self: https://api.example.com/foo\ninfo:\n  title: Example API\n  version: 1.0.0\npaths:\n  /pets:\n    get:\n      summary: List pets","takeaways":["A missing servers field means endpoint paths are relative to where the description is served."]},{"id":"openapiintermediate-005","courseId":"openapi-intermediate","domain":"document-structure","topic":"Templated path collisions","prompt":"A Paths Object lists both /pets/{petId} and /pets/{name}, each with its own get operation. Is this document valid under the spec?","hint":"Think about what makes two templated paths the same in the eyes of the spec.","explain":"Two path templates can look different on the page yet match the same kind of URL. Think about whether a placeholder's name changes which URLs a template accepts.","source":"https://spec.openapis.org/oas/latest.html#paths-object","interaction":{"type":"single"},"options":[{"id":"a","text":"No: the two templated paths are identical, so the description is invalid.","why":"Templated paths that differ only in placeholder names count as identical, and identical ones must not coexist."},{"id":"b","text":"Yes: the placeholder names differ, so the two paths are distinct.","whyNot":"Placeholder names do not make a templated path distinct; the spec treats these two as the same path."},{"id":"c","text":"Yes: when a request arrives, tools pick the first path listed.","whyNot":"The spec forbids these paths, so the document fails before any matching takes place."},{"id":"d","text":"Yes, if each get operation has its own operationId.","whyNot":"An operationId does not rescue identical path templates; the templates themselves must differ."}],"answer":"a","explanation":"Templated paths with the same hierarchy but different placeholder names are considered identical, and such paths MUST NOT coexist in a Paths Object.","concept":"Templated paths with the same hierarchy but different placeholder names are considered identical, and such paths MUST NOT coexist in a Paths Object.","rev":1,"updatedAt":"2026-10-26","kind":"scenario","code":"paths:\n  /pets/{petId}:\n    get:\n      summary: Get one pet\n  /pets/{name}:\n    get:\n      summary: Get one pet by name","takeaways":["Placeholder names don't make a templated path unique; the shape does."]}]