dataclasses-jsonschema icon indicating copy to clipboard operation
dataclasses-jsonschema copied to clipboard

DataclassesPlugin fixed (for objects and for arrays).

Open ZdenekM opened this issue 4 years ago • 1 comments

My attempt to fix the issue #126. It works for objects as well as for arrays of objects. I also propose to change the way how the schema is referenced. Right now it is:

content:
  application/json:
    schema: Pet

while I think this would be more appropriate:

content:
  application/json:
    schema:
      $ref: Pet

This PR also adds support for arrays of objects so definitions like this can be used:

content:
  application/json:
    schema:
      type: array
      items:
        $ref: Pet

@s-knibbs Please let me know what you think about this fix and (hopefully) enhancement.

ZdenekM avatar Jul 02 '20 13:07 ZdenekM

@s-knibbs What do you think? If you are ok with the change, I will also update tests and README. It would be great if this PR can make it into release soon - one project I'm working on depends on this. Many thanks!

ZdenekM avatar Sep 16 '20 06:09 ZdenekM