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

Handling visibility=private #3300

Open
lcawl opened this issue Dec 12, 2024 · 3 comments · May be fixed by #3308
Open

Handling visibility=private #3300

lcawl opened this issue Dec 12, 2024 · 3 comments · May be fixed by #3308
Assignees

Comments

@lcawl
Copy link
Contributor

lcawl commented Dec 12, 2024

In #3299 I noticed that one of the operations has visibility=private:

* @availability stack since=5.4.0 stability=stable visibility=private
 * @availability serverless stability=stable visibility=private

It is appropriately omitted from the Serverless OpenAPI document, however it appears in the stack openAPI document: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-validate

Is this disparity because the filter-for-serverless make command (

filter-for-serverless: ## Generate the serverless version from the compiled schema
) has filter-by-availability -- --serverless --visibility=public? If so, where would be the appropriate place to add a similar filter on the other output file?

@Anaethelion
Copy link
Contributor

The source of the filter seems to come from:

let filter: Option<fn(&Option<Availabilities>) -> bool> = match flavor {
"all" => None,
"stack" => Some(|a| {
// Generate public and private items for Stack
clients_schema::Flavor::Stack.available(a)
}),
"serverless" => Some(|a| {
// Generate only public items for Serverless
clients_schema::Flavor::Serverless.visibility(a) == Some(Visibility::Public)
}),
_ => bail!("Unknown flavor {}", flavor),
};

I'll change the filter to match serverless!

@swallez
Copy link
Member

swallez commented Dec 13, 2024

@Anaethelion I'm on it, finishing the tests before the PR

@swallez swallez self-assigned this Dec 13, 2024
@swallez
Copy link
Member

swallez commented Dec 13, 2024

Stack clients also contain private API endpoints, and we reused that policy for the OpenAPI export, which is wrong as it's used to produce the public docs. Fixed in PR #3308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants