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

[Typespec] Request body should not be optional #2133

Closed
Tracked by #2126
HarshaNalluru opened this issue Nov 17, 2023 · 2 comments
Closed
Tracked by #2126

[Typespec] Request body should not be optional #2133

HarshaNalluru opened this issue Nov 17, 2023 · 2 comments
Assignees
Labels
P1 priority 1 RLC

Comments

@HarshaNalluru
Copy link
Member

Request bodies should not be optional

export interface AnalyzeDocumentBodyParam {
  /** Analyze request parameters. */
  body?: AnalyzeDocumentRequest;
}

Source https://github.com/Azure/azure-rest-api-specs/blob/eaf8b6f8e3ae429c8100471a9772a4bee9a5e472/specification/ai/DocumentIntelligence/routes.tsp#L161-L174

@MaryGao
Copy link
Member

MaryGao commented Nov 20, 2023

@HarshaNalluru Just curious why the body should not be optional, I notice the typespec def is optional

analyzeDocument is DocumentIntelligenceLongRunningOperation<
    {
      ...DocumentModelAnalyzeRequestParams;

      @doc("Input content type")
      @header
      contentType: "application/json";

      @doc("Analyze request parameters.")
      @body
      analyzeRequest?: AnalyzeDocumentRequest; // <========== Here is optional body
    },
    AnalyzeResultOperation
  >;

@qiaozha qiaozha added P1 priority 1 RLC labels Nov 22, 2023
@MaryGao
Copy link
Member

MaryGao commented Jul 25, 2024

@HarshaNalluru close this because this is by design and let me know if any concern.

@MaryGao MaryGao closed this as completed Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 priority 1 RLC
Projects
None yet
Development

No branches or pull requests

3 participants