Skip to content

Please repair Swagger/OpenAPI doc (Docker?) #37019

@HaraldWilhelmi

Description

@HaraldWilhelmi

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.14.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

It seems that Dify comes with a OpenAPI documentation (aka Swagger). However, when running
it via docker-compose a few things seem not to work.

✔️ Expected Behavior

When enabling OpenAPI docs via "SWAGGER_UI_ENABLED=True" in .env a fully functional Online
OpenAPI documentation becomes available under /api/swagger-ui.html.

❌ Actual Behavior

  • The page appears empty because /swaggerui is not covered by nginx/conf.d/default.conf. As a workaround
    one may add this to nginx/conf.d/default.conf.template and restart the containers:
    location /swaggerui {
      proxy_pass http://api:5001;
      include proxy.conf;
    }
  • Even with the workaround a few things seem to be off:
    • Some (all?) URLs used are wrong, e.g.: "/api/login" when "/console/api/login" would have worked.
    • Some API docs seem to be out-dated, e.g. the /login path does not document the "remember_me"
      parameter used by the actual web application.

Maybe /api/swagger.json is just outdated and and should be regenerated when building the Docker image?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions