Skip to content

Make parent parameter object optional if all fields are optional #940

Closed
@dolencd

Description

@dolencd

When a specification defines some parameters, such as:

{
  "name": "id",
  "in": "path",
  "required": true,
  "type": "string"
},
{
  "name": "accept-language",
  "in": "header",
  "required": false,
  "type": "string"
}

The current output contains:

parameters: {
    path: {
      id: string;
    };
    header: {
      "accept-language"?: string;
    };
};

Maybe this would be a good option rather than the default behaviour, but I'd like the header key in this example to be optional. This makes sense since all the fields included in it are optional and you may want to include none of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRs welcomePRs are welcome to solve this issue!enhancementNew feature or requestgood first issueStraightforward problem, solvable for first-time contributors without deep knowledge of the projectplannedExpected in an upcoming version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions