Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues happened when enable modular generation for todo project #2377

Open
2 of 4 tasks
Tracked by #2373
kazrael2119 opened this issue Mar 25, 2024 · 3 comments
Open
2 of 4 tasks
Tracked by #2373
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. HRLC p0 priority 0

Comments

@kazrael2119
Copy link
Contributor

kazrael2119 commented Mar 25, 2024

see pr: #2526

Tasks

Support only one success responses

If we have multiple responses defined without error decorator the code can't compile. We should fix it with assuming only one success response code and others would be skipped with a warning.

Handle unsupported credential

When customers defined credential which we are not supported e.g session api key, we should generate code without compile error but give a warning for not supporting.

Fail to import RLC responses in api layer

After disabling form-data operations and this issue is fixed. So we could fix form data first to check if this is a valid issue.

Not support form/data in modular

We have form/data definition and RLC could handle it correctly but modular can't.

    @post
    op createFileAttachment(
      @header contentType: "multipart/form-data",
      @path itemId: TodoItem.id,
      contents: bytes,
    ): OkResponse | NotFoundResponse;

And currently the modular would treat it as Uint8Array but in RLC it is form data schema. So failed to compile.

export function _createFileAttachmentSend(
  context: Client,
  itemId: number,
  contents: Uint8Array,
  options: TodoItemsAttachmentsCreateFileAttachmentOptionalParams = {
    requestOptions: {},
  },
): StreamableMethod<
  | TodoItemsAttachmentsCreateFileAttachment200Response
  | TodoItemsAttachmentsCreateFileAttachment404Response
> {
  return context
    .path("/items/{itemId}/attachments", itemId)
    .post({
      ...operationOptionsToRequestParameters(options),
      contentType: (options.contentType as any) ?? "multipart/form-data",
      body: { contents: uint8ArrayToString(contents, "base64") },
    }) as StreamableMethod<
    | TodoItemsAttachmentsCreateFileAttachment200Response
    | TodoItemsAttachmentsCreateFileAttachment404Response
  >;
}
@qiaozha qiaozha added priority-0 HRLC bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Mar 27, 2024
@qiaozha qiaozha added p0 priority 0 and removed priority-0 labels Apr 4, 2024
@qiaozha
Copy link
Member

qiaozha commented May 15, 2024

@kazrael2119 can you retry this with the latest code?

@joheredi
Copy link
Member

joheredi commented Jul 2, 2024

Is this still reproducing? @qiaozha @MaryGao can you please update the title with information about the issue and add details on what's causing this?

@MaryGao MaryGao changed the title [modular] fail to generate todo_non_branded code with isModularLibrary: true Fix issues happened when enable modular generation for todo project Jul 25, 2024
@MaryGao
Copy link
Contributor

MaryGao commented Jul 25, 2024

Should have dependency with #2279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. HRLC p0 priority 0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants