Skip to content

Every property in Typescript defined as required #52

@edvald

Description

@edvald

It seems the conversion from Swagger to TypeScript incorrectly makes every parameter on request body types required. In a lot of cases the request parameters contain all of the properties that you'd expect when fetching objects, which ofter you can't use in the request body, so the only feasible workaround is to cast to with <any> or Partial<T>. For example, status is required in the interface for the body for createNamespace, which of course doesn't make sense when creating a namespace.

I'm not sure if this is an upstream issue with swagger-codegen or the configuration, but for the library to work as expected, there probably needs to be a separation between types returned from read/list calls, and the types used for create/patch calls.

Let me know if we can help with this, we're likely to be heavy users of the library so we're happy to contribute, but would probably need some pointers to get started .)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions