ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 201 - MCD - Level 1 discussion

Report
Export

A company has defined two RAML fragments, Book Data Type and Book Example to be used in APIs.

What would be valid RAML to use these fragments ?

A.
1. #%RAML 1.0 2. title: Books 3. types: 4. Book: ABC/Examples/bookDataType.raml 5. /books: 6. post: 7. body: 8. application/json: 9. type: Book 10. examples: 11. input: ABC/Examples/bookExample.raml 12. responses: 13. 201: 14. body: 15. application/json: 16. example: 17. message: Book added
Answers
A.
1. #%RAML 1.0 2. title: Books 3. types: 4. Book: ABC/Examples/bookDataType.raml 5. /books: 6. post: 7. body: 8. application/json: 9. type: Book 10. examples: 11. input: ABC/Examples/bookExample.raml 12. responses: 13. 201: 14. body: 15. application/json: 16. example: 17. message: Book added
B.
1. #%RAML 1.0 2. title: Books 3. Book: !include bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: !include bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
Answers
B.
1. #%RAML 1.0 2. title: Books 3. Book: !include bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: !include bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
C.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
Answers
C.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
D.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
Answers
D.
1. #%RAML 1.0 2. title: Books 3. Book: bookDataType.raml 4. /books: 5. post: 6. body: 7. application/json: 8. type: Book 9. examples: 10. input: bookExample.raml 11. responses: 12. 201: 13. body: 14. application/json: 15. example: 16. message: Book added
Suggested answer: D

Explanation:

* RAML file contains lot of information that could be considered as 'not API-describing'. Sort of 'economy-class' members.Equally important, but not necessarily part of the main RAML file.* Through !includes, RAML allows us to build file-distributed API definitions, which is not only useful to encourage code reuse but also improves readability.* We can create RAML fragments with such code and then include them in main RAML project using !include like:types:Book: !include bookDataType.raml andexamples:input: !include bookExample.raml* Additionally for----------------------------------------------------------------------------------------------------------------------------------------Answer:: D

asked 18/09/2024
Thomas Spring
28 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first