codex/public-api-docs #38

Merged
Twyco merged 6 commits from codex/public-api-docs into main 2026-04-24 09:11:49 +00:00
Showing only changes of commit cebc945fbe - Show all commits
@@ -8,10 +8,13 @@ class PublicApiDocumentationTest extends TestCase
{
public function test_scalar_api_docs_are_public(): void
{
$this->get('/api/docs')
->assertOk()
->assertSee('"hideClientButton":true', false)
->assertSee('"mcp":{"disabled":true}', false);
$response = $this->get('/api/docs')
->assertOk();
Outdated
Review

Nit/Optional: These assertions depend on Scalar's exact minified JSON serialization ("hideClientButton":true / "mcp":{"disabled":true}), which is brittle across package updates. Prefer asserting stable behavior (e.g., response OK plus the configured OpenAPI URL) instead of exact formatting.

Nit/Optional: These assertions depend on Scalar's exact minified JSON serialization (`"hideClientButton":true` / `"mcp":{"disabled":true}`), which is brittle across package updates. Prefer asserting stable behavior (e.g., response OK plus the configured OpenAPI URL) instead of exact formatting.
$content = (string) $response->getContent();
$this->assertMatchesRegularExpression('/"hideClientButton"\s*:\s*true/', $content);
$this->assertMatchesRegularExpression('/"mcp"\s*:\s*\{\s*"disabled"\s*:\s*true\s*\}/', $content);
}
public function test_openapi_document_is_publicly_served(): void