Home »
MCQs
Swagger MCQs
Swagger is a suite of tools for API developers from SmartBear Software and a former specification upon which the OpenAPI Specification is based.
Swagger MCQs: This section contains multiple-choice questions on Swagger. All MCQs have the correct answers and explanations. These MCQs will help students and professionals to test their skills and to enhance their knowledge of Swagger.
List of Swagger MCQs
1. What is the full form of API?
- Administration programming interface
- Application programming intersection
- Application programmatical interface
- Application programming interface
Answer: D) Application programming interface
Explanation:
API stands for an application programming interface.
Discuss this Question
2. Swagger specifically deals with the ____ API.
- GraphQL API
- Web API
- Amazon API
Answer: B) Web API
Explanation:
Swagger specifically deals with the Web API.
Discuss this Question
3. An ____ is a file that lists all the operations that may be performed on a file.
- API Definition File
- API Operation File
- API Definition
Answer: A) API Definition File
Explanation:
An API Definition File is a file that lists all the operations that may be performed on a file.
Discuss this Question
4. Which of the following things does an API definition file includes?
- It contains how authorization is handled in terms of security
- It contains Every resource that is accessible through that API
- All the different data that you can send in a request.
- All of the above
Answer: D) All of the above
Explanation:
The API Definition File includes the following information: how authorization is handled in terms of security, Every resource that is accessible through that API, and every type of requestable data.
Discuss this Question
5. We mainly specify the request body in ____ format for some methods such as PUT, POST, etc
- Plain Text
- CSV
- XLs
- JSON
Answer: D) JSON
Explanation:
We mainly specify the request body in JSON format for some methods such as PUT, POST, etc.
Discuss this Question
6. The response body in REST can be anything, although it is often expressed in which format?
- Plain Text
- CSV
- XLs
- JSON
Answer: D) JSON
Explanation:
The response body in REST can be anything, although it is often expressed in JSON format.
Discuss this Question
7. ____ is the process of confirming a user's identity using their login and password.
- Authentication
- Authorization
Answer: A) Authentication
Explanation:
Authentication is the process of confirming a user's identity using their login and password.
Discuss this Question
8. YAML stands for ____.
- Any markup language
- API markup language
- Ain't markup language
- A markup language
Answer: C) Ain't markup language
Explanation:
YAML stands for Ain't Markup Language.
Discuss this Question
9. YAML is used for the content, not for the data.
- True
- False
Answer: B) False
Explanation:
YAML is used for the data, not for the content.
Discuss this Question
10. Authorization means allowing the user to access the data?
- True
- False
Answer: A) True
Explanation:
Authorization means allowing the user to access the data.
Discuss this Question
11. The data in YAML is represented in which form?
- Graph
- Plain text
- List
- key/value pairs
Answer: D) key/value pairs
Explanation:
The data in YAML is represented in the form of key/value pairs.
Discuss this Question
12. Levels in YAML are indicated by ____.
- white space indenting,
- Curly brackets
- Parenthesis
- None
Answer: A) white space indenting,
Explanation:
Levels are indicated by white space indenting.
Discuss this Question
13. In YAML do we need Quotes around the strings?
- Yes
- No
Answer: B) No
Explanation:
With YAML, we don't require quotes around the strings since levels are represented by white space indenting. One exception is that quotations are necessary if anything is understood to be a number or a Boolean value.
Discuss this Question
14. In YAML, we need to use a ____ to indicate a list item.
- Bullets
- ~
- Dash
- Square brackets
Answer: C) Dash
Explanation:
In YAML, we need to use a ____ to indicate a list item.
Discuss this Question
15. What do you mean by OAS?
- Open API System
- Open API Serialization
- Open API Specification
- Open API Specialization
Answer: C) Open API Specification
Explanation:
OAS stands for Open API Specification.
Discuss this Question
16. Which of the following is a tool that enables real-time documentation preview and editing of Open API specifications in YAML within the browser?
- Swagger Editor
- Swagger Core
- Swagger Codegen
- Swagger Inspector
Answer: A) Swagger Editor
Explanation:
A Swagger Editor is a tool that enables real-time documentation preview and editing of Open API specifications in YAML within the browser.
Discuss this Question
17. Which of the following is a tool that enables us to create attractive documentation dynamically? It is a collection of HTML, JavaScript, and CSS elements.
- Swagger Codegen
- Swagger Core
- Swagger UI
- Swagger Inspector
Answer: C) Swagger UI
Explanation:
Swagger UI is a tool that enables us to create attractive documentation dynamically. It is a collection of HTML, JavaScript, and CSS elements.
Discuss this Question
18. The object is identified as a reference to another structure in the YAML file by the special OAS key known as ____.
- –unique
- $ reference
- $ref
- $ key
Answer: C) $ref
Explanation:
The object is identified as a reference to another structure in the YAML file by the special OAS key known as $ref.
Discuss this Question
19. Which of the following is the advantage of API testing?
- Language Independent
- GUI Independent
- Improved Test Coverage –
- Faster Release
- All of the above
Answer: E) All of the above
Explanation:
The following are some advantages of API testing:Language Independent, Increased Test Coverage, GUI Independent, Quicker Release.
Discuss this Question
20. ____ is a testing tool for APIs that enables you to check your APIs and create OpenAPI specifications from an already-existing API.
- Swagger Inspector
- Swagger Tester
- Swagger Inspect
Answer: A) Swagger Inspector
Explanation:
Swagger Inspector is a testing tool for APIs that enables you to check your APIs and create OpenAPI specifications from an already-existing API.
Discuss this Question
21. Which of the following Protocols is used by API Testing?
- HTTP
- JMS
- UDDI
- All of the above
Answer: D) All of the above
Explanation:
Protocols used by API Testing are as follows:
Discuss this Question
22. Which of the following tool enables us to automatically produce the documentation, server stubs, and client libraries for the API?
- Swagger Codegen
- Swagger Core
- Swagger UI
- Swagger Inspector
Answer: A) Swagger Codegen
Explanation:
Swagger Codegen enables us to automatically produce the documentation, server stubs, and client libraries for the API.
Discuss this Question
23. Which of the following statement is TRUE?
- POSTMAN is a specification for APIs, whereas SWAGGER is an API client.
- SWAGGER is a specification for APIs, whereas POSTMAN is an API client.
Answer: B) SWAGGER is a specification for APIs, whereas POSTMAN is an API client.
Explanation:
Statement B is correct, SWAGGER is a specification for APIs, whereas POSTMAN is an API client.
Discuss this Question
24. The ____ is used to create, consume, and interact with API specifications, is a collection of java-related libraries.
- Swagger core
- Swagger Java
- Swagger Script
Answer: A) Swagger core
Explanation:
The Swagger core, which is used to create, consume, and interact with API specifications, is a collection of Java-related libraries.
Discuss this Question
25. Swagger is good for testing an API based on specifications?
- True
- False
Answer: B) False
Explanation:
Postman is good for testing an API based on specifications, whereas Swagger tools are excellent for API-first development.
Discuss this Question
26. Among SOAP and REST which of them is faster?
- SOAP
- REST
Answer: B) REST
Explanation:
SOAP is slower, and REST is faster.
Discuss this Question
27. The client state is not kept on the server due to the REST architecture's design. ____ is the term used to describe this.
- Statelessness
- State fullness
Answer: A) Statelessness
Explanation:
The client state is not kept on the server due to the REST architecture's design. Statelessness is the term used to describe this.
Discuss this Question
28. In REST, any HTTP Request has how many main components?
- 2
- 3
- 4
- 5
Answer: D) 5
Explanation:
In REST, any HTTP Request has 5 main components, they are:
- Method/Verb
- URI −
- HTTP Version
- Request Header
- Request Body
Discuss this Question
29. HTTP Response has how many components?
- 2
- 3
- 4
- 5
Answer: C) 4
Explanation:
HTTP Response has 4 components:
- Response Status Code
- HTTP Version
- Response Header
- Response Body
Discuss this Question
30. Which of the following annotation is used for mapping requests to specific handler classes or methods?
- @RequestPath
- @RequestMethod
- @RequestDict
- @RequestMapping
Answer: D) @RequestMapping
Explanation:
@RequestMapping annotation is used for mapping requests to specific handler classes or methods.
Discuss this Question