2 seperate POST methods in API Designer issue


#1

Why can I not have POST methods in API Designer?

The UI doesn’t display the 2 POST methods. The first POST will send JSON ObjectA and the second will send JSON ObjectB.

#%RAML 0.8
---
title: API
version: v1
baseUri: https://localhost:9080/{version}
mediaType: application/json
/resource:
  displayName: Resource
  description: |
  post:
    description: |
      Post JSON Object A      
    responses:
      200:
        body:
          schema: |              
          example: |  
  post:            
    description: |
      Post JSON Object B
    responses:
      200:
        body:
          schema: |              
          example: |               

#2

Because that is not supported by the spec and are other ways to handle this.

If in your POST, you can receive any one of many different JSON objects, you should use the anyOf property of JSON schema in your schema definition to reflect this.