Skip to content

Consider adding typealiases for Operations.*.Input.* types for referenced types #32

Open
@czechboy0

Description

@czechboy0

When all types are inline, you get consistent names for all operations:

  • Operations.<operationID>.Input.Path
  • Operations.<operationID>.Input.Query
  • Operations.<operationID>.Input.Headers
  • Operations.<operationID>.Input.Cookies
  • Operations.<operationID>.Input.Body

And similar for Operations.<operationID>.Output.

When using reusable types for requestBody, parameter, and response, however, these can point directly to e.g. Components.RequestBodies.Foo, etc, which breaks the symmetry.

Consider emitting a typealias here that would make all the names predictable, e.g.

enum Operations {
  enum <operationId> {
    struct Input {
      typealias Body = Components.RequestBodies.Foo
    }  
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/generatorAffects: plugin, CLI, config file.kind/usabilityUsability of generated code, ergonomics.status/needs-designNeeds further discussion and a concrete proposal.🆕 semver/minorAdds new public API.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions