rbren / fhir-swagger

Generate Swagger from a FHIR conformance profile
MIT License
61 stars 32 forks source link

Incorrect optionality of attributes #17

Open mjcgm opened 5 years ago

mjcgm commented 5 years ago

The optionality of the attributes is not considered correctly. E.g. in the generated Swagger file, the Patient.gender is said to be required although the conformance statement doesn't. We used

fhir-swagger --fhir_url http://test.fhir.org/r3 --conformance_path="/metadata?_format=application/json" --dstu3 --output r3.json

and got

    ...
    "Patient": {
      "description": "",
      "type": "object",
      "properties": {
        ...
        "gender": {
          "type": "string",
          "minLength": 1
        },
        ...
      },
      "required": [
        "resourceType",
        "id",
        "text",
        "identifier",
        "active",
        "name",
        "gender",
        "photo",
        "contact",
        "managingOrganization",
        "link"
      ]
    },
    ...