swagger-marshmallow-codegen icon indicating copy to clipboard operation
swagger-marshmallow-codegen copied to clipboard

📝 careless schema definitions (memo)

Open podhmo opened this issue 5 years ago • 4 comments

podhmo avatar Nov 01 '20 03:11 podhmo

definitions:
  person:
    properties:
      name:
        type: string
     age:
        type: integer
    required:
      -name # not - name

podhmo avatar Nov 01 '20 03:11 podhmo

definitions:
  Person:
    memo:
       $ref: "#/definitions//Memo"  # not /Memo
  Memo: ...

podhmo avatar Nov 01 '20 09:11 podhmo

{
  "definitions": {
    "Box": {
      "additionalProperties": {
        "$ref": "#definitions/value" //  #/definitions/value is correct value
      },
      "properties": {
        "name": {
          "type": "string"
        }
      }
    },
    "value": {
      "type": "integer"
    }
  },
  "version": "2.0.0"
}

podhmo avatar Nov 04 '20 01:11 podhmo

"children4": {
  "type": "array",
  "items": {
    "name": {
      "type": "string"
    },
    "age": {
      "type": "integer"
    },
    "children": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Person"
      }
    }
  }
}

podhmo avatar Nov 15 '20 04:11 podhmo