Skip to content

Bug 1863077 - Add OpenAPI spec for REST API - #2856

Open
dklawren wants to merge 1 commit into
mozilla:masterfrom
dklawren:openapi-swagger
Open

dklawren wants to merge 1 commit into
mozilla:masterfrom
dklawren:openapi-swagger

Conversation

@dklawren

@dklawren dklawren commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator
image_71b515a6e62124f3

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The component creation and update schemas require JSON bodies, causing schema-based validation to reject supported query-only and form requests.

1 open issue
What changed in this PR

Introduces incremental OpenAPI documentation for Bugzilla’s REST API, starting with Component endpoints, plus an interactive explorer.

Changes:

  • Generate and serve a specification from routes and controller fragments.
  • Add a locally hosted Swagger UI explorer.
  • Check route coverage and validate documented responses in REST tests.
File Description
template/​en/​default/​pages/​api_explorer.html.tmpl Add explorer page and request warning.
t/​api-openapi.t Test specification, routing, and explorer markup.
skins/​standard/​api-explorer.css Integrate explorer styling.
scripts/​build-frontend.mjs Include Swagger UI assets.
qa/​t/​rest_user_update_protected.t Hook response validation.
qa/​t/​rest_user_update_credentials.t Hook response validation.
qa/​t/​rest_user_suggest_whoami.t Hook response validation.
qa/​t/​rest_user_offer_account_by_email.t Hook response validation.
qa/​t/​rest_user_get.t Hook response validation.
qa/​t/​rest_user_create.t Hook response validation.
qa/​t/​rest_triage_owners.t Hook response validation.
qa/​t/​rest_see_also.t Hook response validation.
qa/​t/​rest_search_api.t Hook response validation.
qa/​t/​rest_reminders.t Hook response validation.
qa/​t/​rest_relationship_trees.t Hook response validation.
qa/​t/​rest_pulsebot.t Hook response validation.
qa/​t/​rest_product.t Hook response validation.
qa/​t/​rest_product_create.t Hook response validation.
qa/​t/​rest_phabbugz_attachment.t Hook response validation.
qa/​t/​rest_needinfo_mentions.t Hook response validation.
qa/​t/​rest_native_login.t Hook validation for both clients.
qa/​t/​rest_last_change_time_non_bot.t Hook response validation.
qa/​t/​rest_lando_uplift.t Hook response validation.
qa/​t/​rest_group_update_protected.t Hook response validation.
qa/​t/​rest_group_get.t Hook response validation.
qa/​t/​rest_group_create.t Hook response validation.
qa/​t/​rest_github_push_comment.t Hook response validation.
qa/​t/​rest_github_pull_requests.t Hook response validation.
qa/​t/​rest_github_pull_request.t Hook response validation.
qa/​t/​rest_flag_types.t Hook response validation.
qa/​t/​rest_field.t Hook response validation.
qa/​t/​rest_components.t Hook response validation.
qa/​t/​rest_classification.t Hook response validation.
qa/​t/​rest_bugzilla.t Hook response validation.
qa/​t/​rest_bug.t Hook response validation.
qa/​t/​rest_bug_user_last_visit.t Hook response validation.
qa/​t/​rest_bug_update.t Hook response validation.
qa/​t/​rest_bug_update_see_also.t Hook response validation.
qa/​t/​rest_bug_update_attachment.t Hook response validation.
qa/​t/​rest_bug_search.t Hook response validation.
qa/​t/​rest_bug_routes.t Hook response validation.
qa/​t/​rest_bug_possible_duplicates.t Hook response validation.
qa/​t/​rest_bug_object_condition.t Hook response validation.
qa/​t/​rest_bug_legal_values.t Hook response validation.
qa/​t/​rest_bug_history.t Hook response validation.
qa/​t/​rest_bug_get.t Hook response validation.
qa/​t/​rest_bug_date_fields.t Hook response validation.
qa/​t/​rest_bug_create.t Hook response validation.
qa/​t/​rest_bug_comments.t Hook response validation.
qa/​t/​rest_bug_comment_misc.t Hook response validation.
qa/​t/​rest_bug_comment_edits.t Hook response validation.
qa/​t/​rest_bug_attachments.t Hook response validation.
qa/​t/​rest_bug_add_comment.t Hook response validation.
qa/​t/​rest_bug_add_attachment.t Hook response validation.
qa/​t/​rest_attachment_redirect.t Hook response validation.
qa/​t/​lib/​QA/​OpenAPI.pm Validate responses against the served specification.
package.json Add Swagger UI and disable install analytics.
package-lock.json Lock new frontend dependencies.
Makefile.PL Declare YAML::XS dependency.
js/​api-explorer.js Initialize Swagger UI and theme handling.
docs/​en/​md/​api/​index.md Link explorer and describe partial coverage.
cpanfile Declare YAML::XS dependency.
Bugzilla/​App/​Controller/​Docs.pm Route and render the explorer.
Bugzilla/​App/​Controller/​API.pm Serve and cache the specification.
Bugzilla/​API/​V1/​Component.openapi.yaml Describe Component operations and schemas.
Bugzilla/​API/​openapi.yaml Define shared metadata, authentication, and errors.
Bugzilla/​API/​OpenAPI.pm Assemble fragments and match documented routes.

Review effort: Balanced

Comment on lines +304 to +306
required: true
content:
application/json:

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants