Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Question: How to access request type #93

Open
Purukitto opened this issue Jul 27, 2021 · 1 comment
Open

Question: How to access request type #93

Purukitto opened this issue Jul 27, 2021 · 1 comment

Comments

@Purukitto
Copy link

Purukitto commented Jul 27, 2021

Library version used
0.5.0

Language library used with
Java

Describe the issue
I am unable to find a method to access the type of request defined in the raml file

Input you have issues with
Below is the relavent section of RAML file

/testEndpoint:
      type: rt.Item
      post:
        is: [t.ReturnsItemCreated, t.ExpectsContext, t.ReturnsNotFound, t.ReturnsBadGateway, t.ReturnsCommonErrors, t.NotCacheable]
        body:
          application/json:
            type: bu.BlockCodeUpdatesRequestType
            examples:
              de-cards-bc: !include examples/example1.json
        responses:
          201:
            body:
              application/json:
                type: bu.DeviceManagementResponseType
                example: !include examples/ex2.json   

Code you have issues with
After going through the documentation, I tried using operation.request().payloads().get(0).mediaType().value() but that returns application/json which isn't what I want, I want the type inside the application/json i.e. bu.BlockCodeUpdatesRequestType. Same is the case with the examples, I am unable to read those, the payloads().get(0).examples() comes up as empty for some reason and I don't know to access these. Getting just the path in the examples is enough.

Additional context
The variables like rt bu are RAML library files defined under uses:

@Purukitto
Copy link
Author

Any sort of help/insight will be appreciated, I have been stuck at this for a long time with no success till now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant