Repository navigation
Refs #API-19: Add title to every components schema - #23
Merged
franco-mariani merged 2 commits intoNov 13, 2026
Merged
Conversation
Documentation portals (e.g. Swagger Elements) show referenced schemas as anonymous objects unless they have a title. Set each component schema's title to its name.
There was a problem hiding this comment.
🟢 Approval recommended
The centralized implementation correctly covers object and enum component schemas with aligned tests and fixture output.
0 open findings
What changed in this PR
Adds schema titles so documentation portals display meaningful names for referenced OpenAPI components.
Changes:
- Adds titles to generated object and enum schemas.
- Updates unit expectations and the generated JSON:API fixture.
- Documents the behavior in the changelog.
| File | Description |
|---|---|
lib/graphql_to_rest/schema/basic/components/schemas/type_to_schemas.rb |
Generates titles for object and enum schemas. |
spec/lib/graphql_to_rest/schema/basic/components/schemas/type_to_schemas_spec.rb |
Verifies basic schema titles. |
spec/lib/graphql_to_rest/schema/basic/components/request_bodies/type_to_schemas_spec.rb |
Verifies input schema titles. |
spec/lib/graphql_to_rest/schema/json_api/components/schemas/type_to_schemas_spec.rb |
Verifies JSON:API schema titles. |
spec/fixtures/apps/dummy_app_json_api/public/openapi.json |
Updates generated OpenAPI output. |
CHANGELOG.md |
Records the new schema-title behavior. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
matas-simonaitis
approved these changes
Oct 26, 2026
franco-mariani
deleted the
feature/api-19-api-v2-openapi-spec-schema-title
branch
November 13, 2026 13:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: https://linear.app/samesystem/issue/API-19/api-v2-openapi-spec-schema-title
Problem
In Swagger Portal "Elements" (and similar doc portals), schemas referenced via
$refshow up as anonymous objects because they have notitle.Change
Basic::Components::Schemas::TypeToSchemasnow setstitleto the schema name for both object and enum schemas. Allcomponents.schemasentries go through this class, so it covers basic and JSON:API schemas as well as request-body input schemas:Inline schemas inside
pathsare unchanged.Tests
type_to_schemas_spec.rbfilesspec/fixtures/apps/dummy_app_json_api/public/openapi.json(only adds the 9titlelines)bundle exec rspec: 123 examples, 0 failures