0

Hi guys I'm trying to append a new properties to a reference object but I can't seem to find the correct answer here's what I'm trying to achieve and the result should be something like below

{
  "results": {         
     "param1": "Add",
     "param2": {},
     "object1": "obj",
     "object2": "object"
  }
 }

So below is what I did

responses:
    results:
        description: My description here
        schema:
            $ref: '#/definitions/Success'
definitions:
    Success:
       properties:
          param1:
            type: string
            default: Add
          param2:
            type: object
          $ref: '#/definitions/ObjectData'
    ObjectData:
       properties:
          object1:
             type: string
             default: obj
          object2:
             type: string
             default: object
MadzQuestioning
  • 3,341
  • 8
  • 45
  • 76

1 Answers1

0

If I were to do that result this would be my approach

resoponses:
    result:
    description: Description here
    schema:
        $ref: '#/definitions/Success'
properties:
Success:
    param1:
        type: string
        default: 'Add'
    param2:
        type: object
        properties:
            object1: 
                $ref: '#/definitions/object1'
            object2: 
                $ref: '#/definitions/object2'