Skip to content

Fix OpenAPI docs server URL to match actual listen address#2916

Open
themightychris wants to merge 1 commit intoanyproto:developfrom
themightychris:GO-0000-fix-openapi-host-port
Open

Fix OpenAPI docs server URL to match actual listen address#2916
themightychris wants to merge 1 commit intoanyproto:developfrom
themightychris:GO-0000-fix-openapi-host-port

Conversation

@themightychris
Copy link
Copy Markdown

@themightychris themightychris commented Feb 1, 2026

The OpenAPI specification was hardcoded to http://127.0.0.1:31009 but anytype-cli runs on port 31012 by default.

This PR updates the OpenAPI 3.1.0 spec to dynamically set the server URL (servers[0].url) to match the actual listen address.

Changes:

  • Modified core/api/service.go to update the server URL in embedded OpenAPI docs
  • The server URL now reflects the actual port configured via --listen-address or default settings
  • Works with OpenAPI 3.1.0 spec (uses servers[0].url instead of legacy Swagger 2.0 host field)

This is needed for anytime-mcp to be able to work with the anytype-cli-hosted endpoint out of the box

themightychris added a commit to themightychris/anytype-heart that referenced this pull request Feb 1, 2026
themightychris added a commit to themightychris/anytype-heart that referenced this pull request Feb 2, 2026
@themightychris themightychris force-pushed the GO-0000-fix-openapi-host-port branch from 6f67ab9 to cdfad01 Compare February 2, 2026 04:43
themightychris added a commit to themightychris/anytype-heart that referenced this pull request Feb 2, 2026
@themightychris themightychris changed the title Fix OpenAPI docs host to match actual listen address Fix OpenAPI docs server URL to match actual listen address Feb 2, 2026
themightychris added a commit to themightychris/anytype-heart that referenced this pull request Feb 2, 2026
themightychris added a commit to themightychris/anytype-heart that referenced this pull request Feb 3, 2026
The OpenAPI spec was hardcoded to http://127.0.0.1:31009 but
anytype-cli runs on port 31012 by default. Now the server URL
in the OpenAPI docs is dynamically updated to match the actual
listen address.

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
@themightychris themightychris force-pushed the GO-0000-fix-openapi-host-port branch from cdfad01 to 009f246 Compare February 3, 2026 02:57
themightychris added a commit to themightychris/anytype-heart that referenced this pull request Feb 3, 2026
themightychris added a commit to themightychris/anytype-heart that referenced this pull request Feb 3, 2026
@deff7
Copy link
Copy Markdown
Member

deff7 commented Feb 10, 2026

Hi @themightychris! Thank you for your contribution

@deff7
Copy link
Copy Markdown
Member

deff7 commented Feb 10, 2026

@themightychris you need to sign your commits before we can merge your code. Please, check this https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

@themightychris
Copy link
Copy Markdown
Author

@deff7 thanks! will update all my PRs sometime this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants