Forum Discussion

rramanadham's avatar
rramanadham
New Contributor
6 years ago

swagger schema to have a property whose value is concatenation of a string and a property value

1. I have my body schema as below. How can I use the value of type property in my eventName property? 2. what's the best way to set the audit value to true in the schema "refreshSchema": { "ty...
  • HKosova's avatar
    6 years ago

    1. OpenAPI Specification does not have a way to define dynamic/computed values. These values will have to be computed by the sender of the data.

     

    2. Your example is correct, but if you mean that "audit" is always true use an enum instead:

    "audit": {"type": "boolean", "enum" [true]},
  • RonRatovsky's avatar
    6 years ago

    There's no real way of enforcing that in the spec.