Using objects in formData in OpenAPI 2.0 (how to $ref?)
Hi,
Using OpenAPI 2.0, I have a number of parameters for a post operation. I can't figure out how to handle object types, and in particular using $ref to their properties. For a string parameter, for example, I do:
- name: parameterName
description: parameterDescription
in: formData
required: true
type: string
But for an object parameter I thought I could do something like:
- name: parameterName
description: parameterDescription
in: formData
required: true
type: object
properties:
allOf:
- $ref: '#/definitions/MyParameterDescription'
but it, and everything else I've tried, don't seem to work. That is, Stoplight gives me errors like "property should have required property 'schema'" or "$ref cannot be placed next to any other properties" or (when I use 'schema') it tells me that all the other properties shouldn't be there, ...
What is the proper way of doing this? In case it matters, my definition looks something like:
definitions:
MyParameterDescription:
properties:
first_property:
description: ...
I'm pretty sure it is ok because if I have an array and declare items to ref to this it works fine.
Thanks for any help you can offer!
PS I'm completely new to this so apologies if this is obvious but I haven't been able to find examples - I also appreciate any pointers to places I should be looking
Just going through my previous posts (I have a job interview) and I came across this and I now know the answer.
The test was not looping because of the failed step - disabling the test case option checkbox 'Abort test if an error occurs' was the problem.
Just thought I'd update the post with the answer in case anyone else comes across this,
cheers,
richie