ashraful511
5 years agoNew Contributor
Loop keyword test
Hi All,
How do I loop my Keyword Test? I want a single test to run 10 times.
An enum of objects is defined as follows. The enum items are object literals (i.e. using property_name: value syntax), not Schema Objects.
enum: - red: 255 # Red green: 0 blue: 0 - red: 0 # Green green: 255 blue: 0 - red: 0 # Blue green: 0 blue: 255
If these are the only allowed color values you can add this enum to the base Color schema. Otherwise you can use allOf to create a schema that extends the Color schema with this enum, like so:
definitions: Buble: type: object description: Demo object with the wished enum properties: color: $ref: '#/definitions/colors' colors: description: Eine Auswahl von Farben allOf: - $ref: '#/definitions/Color' - enum: - red: 255 # Red green: 0 blue: 0 - red: 0 # Green green: 255 blue: 0 - red: 0 # Blue green: 0 blue: 255 Color: type: object description: General color object properties: red: type: integer green: type: integer blue: type: integer
j2020 wrote:
The problem is, that the enum values are not shown in the presentation of the swagger.
This is a limitation of Swagger Editor and Swagger UI - they do not support enums of objects. You can submit an enhancement request here: