Skip to content

docs(openapi)!: course API contract release for course kinds - #3490

Closed
Ethanlita wants to merge 6 commits into
goplus:issue-3403-tutorial-v2from
Ethanlita:issue-3422-openapi-contract
Closed

Ethanlita wants to merge 6 commits into
goplus:issue-3403-tutorial-v2from
Ethanlita:issue-3422-openapi-contract

Conversation

@Ethanlita

Copy link
Copy Markdown
Collaborator

Part of #3403 / #3422. Documents the API contract release for course kinds: the second half of the expand-contract pair whose first half is #3471.

Important

Stacked on #3471: this branch is issue-3422-openapi plus one commit, so the diff shows #3471's changes too until #3471 merges (GitHub cannot base a goplus/builder PR on a fork branch). Review only the last commit (docs(openapi)!: course API contract release for course kinds). Do not merge before goplus/builder-backend#352 is deployed: this document describes the API only that release serves. Until then #3471 stays the accurate contract.

What changes vs. #3471

Area Change
Course Deprecated top-level entrypoint / prompt removed. content is now oneOf GuidedCourseContent / PlaygroundCourseContent, selected by kind (the oneOf promised in the #3471 review, now that the shape is final).
POST /user/courses kind and content required; the transitional flat payload is no longer documented.
PATCH /courses/{id} Flat entrypoint / prompt fields removed; content is validated against the course's kind and replaced as a whole.
POST /user/course-series kind required (omitting it no longer means guided).

New component schemas: GuidedCourseContent (entrypoint non-empty uri-reference, prompt ≤ 12000 chars) and PlaygroundCourseContent (file collection mapping paths to universal URLs; may be empty so a course can be created before its files are uploaded). The copilot-context request keeps its own inline, non-empty file collection.

Matches docs/develop/tutorial-v2/module_CourseApis.ts (Course = GuidedCourse | PlaygroundCourse, CourseSeriesInput with required kind). Verified by the goplus/builder-backend#352 rehearsal (see its description): the documented 400s and response shapes are what the Release 2 binary produces.

Ethanlita and others added 6 commits August 27, 2026 14:15
Sync the API spec with the Tutorial v2 backend changes
(goplus/builder-backend#350/goplus#353/goplus#354), documenting the transitional
expand-release shape:

- Course gains kind (immutable, guided | playground) and kind-specific
  opaque content; the top-level entrypoint/prompt copies are marked
  deprecated and noted for removal by the API contract release.
- Course create/update accept both the kind+content shape and the
  transitional legacy flat payload; update documents kind immutability.
- CourseSeries gains kind; series lists gain a kind filter; series
  create/update document the kind semantics.
- New POST /user/courses/playground/copilot-context endpoint.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Aligns with GeneratePlaygroundCourseCopilotContextInput in
module_CourseApis.ts and the backend validation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The endpoint draws from the copilotMessage quota, so its 403/429
responses follow the same contracts as the other quota-backed endpoints
(40301/42901 with Retry-After). Also state the refund policy precisely:
server-side failures refund, client cancellation does not.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Course.content now shows both kind-specific shapes, and every mention of
the transitional shape's removal points at the concrete contract PR
(goplus/builder-backend#352) instead of an unnamed future release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…guided too

Matches goplus/builder-backend#353: the flat entrypoint/prompt shape applies
to guided creates whether kind is omitted or given, and content wins when
both are present.
Pairs with goplus/builder-backend#352 (migration 018 plus its application
change): the transitional shapes introduced for the expand phase are gone.

- `Course` drops the deprecated top-level `entrypoint` / `prompt`; `content`
  becomes a `oneOf` of the new `GuidedCourseContent` and
  `PlaygroundCourseContent` schemas, selected by `kind`.
- `POST /user/courses` requires `kind` and `content`; the legacy flat payload
  is no longer documented. `PATCH /courses/{id}` no longer accepts the flat
  fields and states that `content` is replaced as a whole.
- `POST /user/course-series` requires `kind`.

BREAKING CHANGE: clients must send `kind` + `content` (and `kind` on course
series) and must read guided course data from `content`.
@Ethanlita

Copy link
Copy Markdown
Collaborator Author

Superseded: folded into #3471 (the spec documents the final contract directly; the transitional superset the Release 1 backend tolerates is noted in #3471's description instead).

@Ethanlita Ethanlita closed this Sep 7, 2026
@Ethanlita
Ethanlita deleted the issue-3422-openapi-contract branch September 7, 2026 07:35
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.

1 participant