Skip to content

The code generator crashes when processing response types with undefined #3425

@v-jiaodi

Description

@v-jiaodi

Generate code error:
Image

Please note the followings:

  • @azure-rest/codetransparency is not in our smoke testing and we put their spec in draft pr: Verify that the library option is set to true for @azure-rest/codetransparency #3424
  • to reproduce this issue, you need to first add their spec in our pr
  • i take a look at the spec and I guess this issue may be from
    @doc("Status code")
    @statusCode
    statusCode: 201;
    @doc("The MIME content type a Cose body is application/cose, containing a CoseSign1 signature.")
    @header("Content-Type")
    contentType: "application/cose";
    @doc("Location of the receipt")
    @header("Location")
    location?: string;
    @doc("Receipt body in COSE format")
    @bodyRoot
    body: bytes;
    .
  • i think for "application/cose" content type the body bytes should be generated as "binary" thing
  • it's better to add this case in our modular unit test

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions