这是indexloc提供的服务,不要输入任何密码
Skip to content

[BUG]: Invalid OpenAPI specification in generated Swagger schema #2218

@MrSimonC

Description

@MrSimonC

How are you running AnythingLLM?

Docker (local)

What happened?

Firstly, I apologize that this is probably going to be one of the most boring pull requests you can ever come across!

Further to the previously logged issue #1988, where @acrive82 pointed out the OpenAPI v3 spec was invalid (honestly, I didn't even realize there was such a thing as a specification until about three weeks ago), I also confirmed this and found a fix (see referenced pull request later).

The issue is that the JSON payload generated by the Swagger API endpoint does not conform to the OpenAPI 3.0 specification. If for example, I use, I wanted to generate their own API client code, they could use open API tools open API generator. e.g. Specifically, running the command:

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i openapi.json -g csharp -o /local/out/csharp

results in an "invalid spec" error.

Please see the referenced pull request for the proposed fix.

Are there known steps to reproduce?

Copy the existing openapi.json file from https://raw.githubusercontent.com/Mintplex-Labs/anything-llm/master/server/swagger/openapi.json and insert it into the Swagger Parser Online Tool, which confirmed that it fails validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    possible bugBug was reported but is not confirmed or is unable to be replicated.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions