-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Correct errors in the API spec #95
Conversation
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
As per https://swagger.io/docs/specification/authentication/ . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
* `type` is already given for the property * `minimum` is a direct attribute of the property (see https://swagger.io/specification/#schema-object) Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
* remove `SameOrigin` security * add CORS to all responses not currently marked `SameOrigin` (sadly, not doable without duplication, see OAI/OpenAPI-Specification#690) Signed-off-by: Pamplemousse <xav.maso@gmail.com>
This is a best effort: I never worked with OpenAPI before, and it's my first contribution to Lichess... |
Thank you so much, this is great! If I'm not mistaken, the /standard:
get:
operationId: tablebaseStandard
summary: Tablebase lookup
description: |
**Endpoint: https://tablebase.lichess.ovh**
Runs https://github.com/niklasf/lila-tablebase with `--sloppy-real-wdl`.
Example: `curl http://tablebase.lichess.ovh/standard?fen=4k3/6KP/8/8/8/8/7p/8_w_-_-_0_1`
tags:
- Tablebase
security: []
parameters:
- in: query
name: fen
description: FEN of the position. Underscores allowed. The halfmove clock is taken into account for WDL values.
schema: # <-----
type: string # <----- these two lines are missing
responses:
200:
description: The tablebase information for the position in standard chess.
headers:
Access-Control-Allow-Origin:
schema:
type: string
default: "'*'"
content:
application/json:
schema:
$ref: '#/components/schemas/TablebaseJson' |
@sjamesr Hey! How do you know this type is missing? I don't see any more errors when running |
Without it, using the default Java generator, the |
Interesting... |
Nice. I really wish we had a way to get rid of the duplication, such as
There is so much duplicated stuff in there, and I think it's the fault of the OpenAPI format. Maybe we should be generating it with an actual programming language instead? |
@ornicar Even if it had a default value, or was declared in a unique place, each response would need to declare a reference to this unique location... The duplication would just be "shifted". |
Fixes #11!
openapi-generator-cli validate -i doc/specs/lichess-api.yaml
gives the remaining spec violations.Signed-off-by: Pamplemousse xav.maso@gmail.com