Skip to content

Fix missing schema re-exports causing test failures - #411

Merged
hotlong merged 3 commits into
copilot/add-http-server-implementationfrom
copilot/fix-step-eight-error
Jan 31, 2026
Merged

hotlong merged 3 commits into
copilot/add-http-server-implementationfrom
copilot/fix-step-eight-error

Conversation

Copilot AI commented Jan 31, 2026 •

Copy link
Copy Markdown
Contributor

CI tests failed because HttpMethod and FieldMappingSchema were imported but not re-exported from modules where tests expected them.

Changes

  • router.zod.ts: Re-export HttpMethod from shared/http.zod.ts
  • external-lookup.test.ts: Use ExternalFieldMappingSchema directly instead of aliased FieldMappingSchema to avoid naming conflict with base schema from shared/mapping.zod.ts

The issue surfaced when both shared/mapping.zod.ts and data/external-lookup.zod.ts exported a FieldMappingSchema through data/index.ts, causing ambiguous module resolution.

// Before: router.zod.ts
import { HttpMethod } from '../shared/http.zod';
// HttpMethod not available to importers

// After: router.zod.ts  
import { HttpMethod } from '../shared/http.zod';
export { HttpMethod };  // Now available to downstream consumers
Original prompt

引用: https://github.com/objectstack-ai/spec/actions/runs/21527954108/job/62036372516#step:8:1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel

vercel Bot commented Jan 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jan 31, 2026 0:35am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ppingSchema

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in step eight of action run Fix missing schema re-exports causing test failures Jan 31, 2026
Copilot AI requested a review from hotlong January 31, 2026 00:35
@hotlong
hotlong marked this pull request as ready for review January 31, 2026 00:37
Copilot AI review requested due to automatic review settings January 31, 2026 00:37
@hotlong
hotlong merged commit 14d984b into copilot/add-http-server-implementation Jan 31, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI failures stemming from missing/ambiguous exports by making HttpMethod available to API consumers and removing a naming collision in the external lookup tests.

Changes:

  • Re-export HttpMethod from packages/spec/src/api/router.zod.ts so it’s available via @objectstack/spec/api.
  • Update external-lookup.test.ts to use ExternalFieldMappingSchema / ExternalFieldMapping instead of the ambiguous FieldMappingSchema / FieldMapping.
  • Add generated JSON Schema output for HttpMethod and introduce a new docs page under references/api.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
packages/spec/src/data/external-lookup.test.ts Avoids FieldMappingSchema naming ambiguity by using the external-lookup-specific schema/type.
packages/spec/src/api/router.zod.ts Re-exports HttpMethod for downstream imports from @objectstack/spec/api.
packages/spec/json-schema/api/HttpMethod.json Adds the JSON Schema artifact for HttpMethod.
content/docs/references/api/view.mdx Adds documentation for HttpMethod under the API docs section (but currently has inconsistencies).

import { CorsConfigSchema, StaticMountSchema, HttpMethod } from '../shared/http.zod';

// Re-export HttpMethod for convenience
export { HttpMethod };

Copilot AI Jan 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export { HttpMethod } only re-exports the runtime Zod schema value. If the intent is to let downstream consumers also import type HttpMethod from @objectstack/spec/api, you also need a type-only re-export (otherwise only @objectstack/spec/shared exposes the type).

Suggested change
export { HttpMethod };
export { HttpMethod };
export type { HttpMethod } from '../shared/http.zod';

Copilot uses AI. Check for mistakes.
# View

<Callout type="info">
**Source:** `packages/spec/src/api/view.zod.ts`

Copilot AI Jan 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The referenced source file packages/spec/src/api/view.zod.ts does not exist in this repo (the HttpMethod schema is defined in packages/spec/src/shared/http.zod.ts). This makes the doc misleading and hard to trace.

Suggested change
**Source:** `packages/spec/src/api/view.zod.ts`
**Source:** `packages/spec/src/shared/http.zod.ts`

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +19
import { HttpMethodSchema } from '@objectstack/spec/api';
import type { HttpMethod } from '@objectstack/spec/api';

// Validate data
const result = HttpMethodSchema.parse(data);

Copilot AI Jan 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TypeScript snippet imports HttpMethodSchema from @objectstack/spec/api, but the API package exports HttpMethod (from shared/http.zod.ts via api/router.zod.ts), not HttpMethodSchema. As written, this example will not compile / will confuse consumers.

Suggested change
import { HttpMethodSchema } from '@objectstack/spec/api';
import type { HttpMethod } from '@objectstack/spec/api';
// Validate data
const result = HttpMethodSchema.parse(data);
import { HttpMethod } from '@objectstack/spec/api';
// Validate data
const result = HttpMethod.parse(data);

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +6
title: View
description: View protocol schemas
---

# View

Copilot AI Jan 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc page is named and titled "View", but its content documents HttpMethod only. Consider renaming the page (and frontmatter/title) to match the schema being documented, or expanding the content to actually cover the API "View" protocol.

Suggested change
title: View
description: View protocol schemas
---
# View
title: HttpMethod
description: HTTP method schema
---
# HttpMethod

Copilot uses AI. Check for mistakes.

This branch was successfully deployed

1 active deployment
Preview — cc70bb6a Deployed Jan 31, 2026 by vercel[bot]
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.

3 participants