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

Provide a way to indicate that a parameter is a "client parameter" #664

Closed
annelo-msft opened this issue Jun 27, 2022 · 3 comments
Closed
Assignees
Labels
design:needed A design request has been raised that needs a proposal
Milestone

Comments

@annelo-msft
Copy link
Member

We would like a way to indicate that the hub parameter in WebPubSub is a "client parameter", meaning it is a private member on the client and taken as a parameter to the client constructor (see WebPubSub APIView).

In swagger, this could be indicated as a global parameter, or by using the x-ms-parameter-location extension and setting the value to client.

@lmazuel
Copy link
Member

lmazuel commented Jul 6, 2022

Do-able short term with:

import "@cadl-lang/openapi";

@doc("The mode with which you'll be handling your returned body. 'raw' for just dealing with the raw body, and 'model' if you are going to convert the raw body to a customized body before returning to users.")
model ModeParameter {
  @OpenAPI.extension("x-ms-parameter-location", "method")
  @doc("The mode with which you'll be handling your returned body. 'raw' for just dealing with the raw body, and 'model' if you are going to convert the raw body to a customized body before returning to users.")
  @path
  mode: Mode;
}

But agree we need a design that don't use OpenAPI.extension long term.

It does generate the right OpenAPIv3, which autorest no problem to consume.

@markcowl
Copy link
Contributor

Discuss with #656

@daviwil
Copy link
Contributor

daviwil commented Jul 27, 2022

Implementation issue: #778

@daviwil daviwil closed this as completed Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal
Projects
None yet
Development

No branches or pull requests

6 participants