Reputation: 1655
I am using Mule 4 and Anypoint Studio 7.
I am currently writing RAML and was looking to add a schema (validate) and example (mock response in API console) to a resource in my RAML but I am getting a generic error.
#%RAML 1.0 Trait
responses:
200:
body:
application/json:
schema: mySchema
example: example/mySchema.json
Is it possible to use both the schema and example against a resource?
Thanks
Upvotes: 0
Views: 607
Reputation: 2650
Here is an example
#%RAML 1.0
version: v1
title: something.raml
mediaType:
application/json
uses:
ResultsRS: path/StudentResultRS.raml
/students:
/results/get:
post:
description: get the results of a student
body:
application/json:
type: ResultsRS.tudentResultRS.raml
examples: !include path/examples/studentresults_RS.raml
you need to make sure that you have properly defined the types and examples.
Upvotes: 1