Issue during POST response declaration with header and body both


#1

Hello there, MY raml is like below:

/action:
post:
description: |
Perform action on a subscriber
body:
application/json:
schema: action
responses:
201:
headers:
location:
type: string
body:
application/json:
schema: Identifier
example: !include action.sample
400:
body:
application/json:
schema: exception
example: !include exception.sample

Here the issue is when it generate the java code then the Action.java is generated but it contains the attribute of identifier.json not the action.json…if i remove the body from response then it will generate Action.java correctly.

2nd question question i have, is there any way to initialize the json object in raml before using that as a schema in raml??


#2

Can you specify what tool you are using? I’m assuming the raml-to-jax-rs codegen tool for now.

I see here:

schema: Identifier

that the /action 201 response uses the Identifier schema, which is maybe why you see the attributes from identifier.json?