podhmo / swagger-marshmallow-codegen

generating marshmallow's schema from swagger definition file
MIT License
52 stars 10 forks source link

📝 careless schema definitions (memo) #59

Open podhmo opened 4 years ago

podhmo commented 4 years ago
definitions:
  person:
    properties:
      name:
        type: string
     age:
        type: integer
    required:
      -name # not - name
podhmo commented 4 years ago
definitions:
  Person:
    memo:
       $ref: "#/definitions//Memo"  # not /Memo
  Memo: ...
podhmo commented 4 years ago
{
  "definitions": {
    "Box": {
      "additionalProperties": {
        "$ref": "#definitions/value" //  #/definitions/value is correct value
      },
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "value": {
      "type": "integer"
    }
  },
  "version": "2.0.0"
}
podhmo commented 4 years ago
"children4": {
  "type": "array",
  "items": {
    "name": {
      "type": "string"
    },
    "age": {
      "type": "integer"
    },
    "children": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Person"
      }
    }
  }
}