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

Question: How to access request type #93

Description

@Purukitto

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:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions