Page MenuHomePhabricator

Create example/test OAD
Closed, ResolvedPublic

Description

Description

As we expand our OpenAPI style guide and define linting rules, it is helpful to have an OpenAPI description (OAD) file that we can easily use for testing rule compliance and socializing best practices.

This OAD is intended to have examples that cover every linting rule, and can be used as a reference. We may introduce automated testing to verify linting behavior, as the OAD should always pass all rules. Additionally, the simplified OAD will create an easier route to test or debug new rules than live OADs. It will also be useful to demonstrate simple examples of expected patterns, which will help guide teams who wish to follow the standards, potentially including references to "good" examples in error messages.

Conditions of acceptance

  • Create an example OAD that can be used for testing and demonstrating desired patterns across teams.
  • Clearly indicate that it is a test document. The content should not be something that could be mistaken for an actual Wikimedia service. There are a few suggestions to accomplish this, but open to other ideas:
    • Follow the "pet shop" example that is frequently used to demonstrate OpenAPI tools.
    • Name the objects after the rules we are defining for clear example mapping (this is half baked and might get tricky, but could be useful).
    • Pick any other "fun" example that can demonstrate functionality without risking Wikimedia domain conflicts or confusion.
  • Determine where we should house the OAD, so that it is discoverable and we can ensure that it remains up to date as new rules are introduced.
  • Work with Moriel to determine if/how we might use it for automated linter testing.
    • This discussion continues in T419576.
NOTE: Although the Tech Docs Team is creating the first instance of this spec, we will have joint ownership with MWI for iterative changes as new rules are created.

[OAD]: Per OpenAPI Initiative Glossary page (CC BY 4.0):

OpenAPI Description (OAD): One or more documents written according to a specific version of the OpenAPI Specification, that together describe an API

Event Timeline

Moving to Radar for MWI, since Kamil is taking lead.

KBach renamed this task from Create example/test spec to Create example/test OAD.Nov 17 2025, 11:41 AM
KBach changed the task status from Open to In Progress.
KBach triaged this task as Medium priority.
KBach updated the task description. (Show Details)

Currently working on the initial version of the OAD in the YAML format. I'm planning to follow the pattern of pet shop API examples unless someone suggests a better alternative.

This is still in progress and will continue next week.

I don't think naming objects after rules is necessary. Instead, I'm trying to make the example as realistic as possible while covering a wide range of correct approaches to describing the API.

The main content and structure of the example OAD is done but I'm still improving summaries and descriptions and making small fixes based on feedback I already received. I also need to write the accompanying README, which will explain some of the choices I made, and highlight some open questions, proposals, and potential issues.

I have also made a few changes to the OAD required and recommended fields spreadsheet (Google doc, restricted access) and to the style guide based on lessons learned here.

First draft of the example is now available for review in this GitLab repository. Note that GitLab doesn't feature a preview tool for OpenAPI descriptions. You can preview the JSON or the YAML file in a local or web viewer of your choice.

I have also created a document with extra notes and open questions (Google document, restricted access).

I've submitted a merge request that adds schema property descriptions to the example (thank you @apaskulin for bringing this up). This change will result in changes to the OAD style guide, so I'd really appreciate feedback either here or in the MR.

You can preview the example using the api-spec-reader tool.

Changes merged. The current version of the OAD is available for preview.

I moved the example repository to repos/technical-documentation/OpenAPI Description Example on GitLab. If you previously cloned the repository, you might have to update the origin URL - e.g. git remote set-url origin git@gitlab.wikimedia.org:repos/technical-documentation/openapi-description-example.git.

Closing this task as resolved - first version of the OAD example is available under repos/technical-documentation on GitLab. Work on the example continues in separate streams: