Bird
0
0

Which of the following is the correct way to define an HTTP GET method for the path /users in OpenAPI YAML?

easy📝 Syntax Q12 of 15
Rest API - API Documentation
Which of the following is the correct way to define an HTTP GET method for the path /users in OpenAPI YAML?
Apaths: get: /users: summary: Get all users
Bpaths: /users: get: summary: Get all users
Cget: paths: /users: summary: Get all users
Dpaths: /users: post: summary: Get all users
Step-by-Step Solution
Solution:
  1. Step 1: Check OpenAPI path structure

    Paths are keys under paths, then HTTP methods like get are nested under each path.
  2. Step 2: Validate correct nesting and method

    paths: /users: get: summary: Get all users correctly places /users under paths and get under /users.
  3. Final Answer:

    paths: /users: get: summary: Get all users -> Option B
  4. Quick Check:

    Paths > /users > get [OK]
Quick Trick: Remember: paths > endpoint > method > details [OK]
Common Mistakes:
MISTAKES
  • Swapping method and path levels
  • Using wrong HTTP method for GET
  • Incorrect YAML indentation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes