Forum Discussion

HenrikHL's avatar
HenrikHL
Frequent Contributor
2 years ago

Is there a way to reuse objects between POST and PUT `requests`?

Our request objects for POST and PUT are very similar - only an identifier (ID) differs in the two. Is there a way to reuse an object between the two? I know that the readOnly property can be used f...
  • chichepo's avatar
    2 years ago

    HenrikHL Hi

    You actually did summarize all the possibilities (2 distinct objects, allOf).
    I am not sure about that but if you define an object including all common properties, you can try to add "additionalProperties: true".
    In such case you will be able to use, several times, the object and to inject the ID only when you need.
    But in such way, the ID is taken into account only during the run time.