add gitea API specs in openAPI format #13337

Closed
opened 2025-11-02 10:38:55 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @milahu on GitHub (Jul 27, 2024).

Feature Description

https://docs.gitea.com/api/1.22/ says

Download OpenAPI specification: https://docs.gitea.com/redocusaurus/plugin-redoc-1.yaml

openapi-python-client fails to read that yaml file

Failed to parse OpenAPI document

You may be trying to use a Swagger document; this is not supported by this project.

$ openapi-python-client generate --url https://docs.gitea.com/redocusaurus/plugin-redoc-1.yaml
Error(s) encountered while generating, client was not created

Failed to parse OpenAPI document

You may be trying to use a Swagger document; this is not supported by this project.

215 validation errors for OpenAPI
paths./admin/hooks.post.parameters.0.Parameter.in
  Input should be 'query', 'path', 'header' or 'cookie' [type=enum, input_value='body', input_type=str]
paths./admin/hooks.post.parameters.0.Reference.$ref
  Field required [type=missing, input_value={'name': 'body', 'in': 'b...ions/CreateHookOption'}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.6/v/missing
paths./admin/hooks/{id}.patch.parameters.1.Parameter.in
  Input should be 'query', 'path', 'header' or 'cookie' [type=enum, input_value='body', input_type=str]
...

but it works with swagger-codegen

swagger-codegen generate \
  -i https://docs.gitea.com/redocusaurus/plugin-redoc-1.yaml \
  -l python \
  -o gitea-client-python \
  -DpackageName=gitea_client

result: gitea-client-python

so ...

either reword https://docs.gitea.com/api/1.22/

-  Download OpenAPI specification
+  Download Swagger API specification

or provide gitea API specs in openAPI format as gitea-api.yaml

Originally created by @milahu on GitHub (Jul 27, 2024). ### Feature Description https://docs.gitea.com/api/1.22/ says > Download OpenAPI specification: https://docs.gitea.com/redocusaurus/plugin-redoc-1.yaml [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) fails to read that yaml file > Failed to parse OpenAPI document > > You may be trying to use a Swagger document; this is not supported by this project. <details> ``` $ openapi-python-client generate --url https://docs.gitea.com/redocusaurus/plugin-redoc-1.yaml Error(s) encountered while generating, client was not created Failed to parse OpenAPI document You may be trying to use a Swagger document; this is not supported by this project. 215 validation errors for OpenAPI paths./admin/hooks.post.parameters.0.Parameter.in Input should be 'query', 'path', 'header' or 'cookie' [type=enum, input_value='body', input_type=str] paths./admin/hooks.post.parameters.0.Reference.$ref Field required [type=missing, input_value={'name': 'body', 'in': 'b...ions/CreateHookOption'}}, input_type=dict] For further information visit https://errors.pydantic.dev/2.6/v/missing paths./admin/hooks/{id}.patch.parameters.1.Parameter.in Input should be 'query', 'path', 'header' or 'cookie' [type=enum, input_value='body', input_type=str] ... ``` </details> but it works with [swagger-codegen](https://github.com/swagger-api/swagger-codegen) ``` swagger-codegen generate \ -i https://docs.gitea.com/redocusaurus/plugin-redoc-1.yaml \ -l python \ -o gitea-client-python \ -DpackageName=gitea_client ``` result: [gitea-client-python](https://github.com/milahu/gitea-client-python) so ... either reword https://docs.gitea.com/api/1.22/ ```diff - Download OpenAPI specification + Download Swagger API specification ``` or provide gitea API specs in openAPI format as `gitea-api.yaml`
GiteaMirror added the type/proposal label 2025-11-02 10:38:56 -06:00
Author
Owner

@lunny commented on GitHub (Jul 28, 2024):

Hi, please send this issue to https://gitea.com/gitea/docs because docs have been splitted as a standalone repository.

@lunny commented on GitHub (Jul 28, 2024): Hi, please send this issue to https://gitea.com/gitea/docs because docs have been splitted as a standalone repository.
Author
Owner

@milahu commented on GitHub (Jul 28, 2024):

moved to https://gitea.com/gitea/docs/issues/37

@milahu commented on GitHub (Jul 28, 2024): moved to https://gitea.com/gitea/docs/issues/37
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13337