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

docs: what is the syntax of {id} in apisix-admin api? #10047

Closed
MirtoBusico opened this issue Aug 17, 2023 · 2 comments · Fixed by #10056
Closed

docs: what is the syntax of {id} in apisix-admin api? #10047

MirtoBusico opened this issue Aug 17, 2023 · 2 comments · Fixed by #10056
Labels
doc Documentation things good first issue Good for newcomers

Comments

@MirtoBusico
Copy link

Current State

In the admin-api api chapter ( https://apisix.apache.org/docs/apisix/admin-api/ ) all the examples for defining SSL, Upstream and Route use an {id}

In the Request methods it is indicated as {...}

In all examples this {id} is a numeric string

There is no explanation of the {id} syntax

Desired State

Add the syntax rules for {id}:

  1. is it numeric
  2. is it a string

If it is a string:

  1. what is the max length
  2. what characters are allowed (letter, numbers, special as - _ . # @ )
@MirtoBusico MirtoBusico added the doc Documentation things label Aug 17, 2023
@shreemaan-abhishek
Copy link
Contributor

Following is the schema for {id}:

https://github.com/shreemaan-abhishek/apisix/blob/6e4347840727c54dd6b79a60e53afc1204938242/apisix/schema_def.lua#L30-L38

local id_schema = {
    anyOf = {
        {
            type = "string", minLength = 1, maxLength = 64,
            pattern = [[^[a-zA-Z0-9-_.]+$]]
        },
        {type = "integer", minimum = 1}
    }
}

@shreemaan-abhishek shreemaan-abhishek added the good first issue Good for newcomers label Aug 17, 2023
@MirtoBusico
Copy link
Author

Fantastic!
It is exactly what I needed!

@kayx23 kayx23 changed the title docs: what is the sintax of {id} in apisix-admin api? docs: what is the syntax of {id} in apisix-admin api? Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Documentation things good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants