Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Bug 1863077 - Add OpenAPI spec for REST APIOpen api #2143

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4714224
Added openapi spec
Nov 27, 2023
2d36d30
Implemented mock-up OpenAPI spec
Nov 28, 2023
9240831
Added "Create a comment on a bug"
Nov 28, 2023
6f2edce
Added "Update tags for a comment"
Nov 28, 2023
19d3d1e
Removed custom property overrides since openapi-generator was complai…
Nov 28, 2023
c46ecf1
Added "Search for comment tags"
Nov 28, 2023
8829dcd
Added "Render comment as HTML"
Nov 28, 2023
895ef67
Added "Get Bug"
Nov 29, 2023
72b81a0
Added "Bug History"
Nov 29, 2023
eb7edf3
Added "Search Bugs"
Nov 29, 2023
5b59eb1
Added "Create Bug"
Nov 29, 2023
257905d
Added "Graph"
Nov 30, 2023
6f2e337
Added "Possible Duplicates"
Nov 30, 2023
38ba199
Added "Update Bug"
Nov 30, 2023
5f4e994
Let openapi-format reorder and format the file
Nov 30, 2023
c3c2f22
Added parameter component "BugIdOrAlias" for re usability.
Dec 4, 2023
5618567
Aligned "Comments" section
Dec 4, 2023
7408586
Aligned "Bugs" section [skip ci]
Dec 4, 2023
d4ccf99
Added "Get Attachment"
Dec 4, 2023
89ae6b5
Added "Create Attachment"
Dec 4, 2023
95c9186
Added "Update Attachment" [skip ci]
Dec 4, 2023
196a993
Resolved refrences
Dec 4, 2023
4c00e80
Added security schemes
Dec 4, 2023
11ad954
Improved description
Dec 4, 2023
3ac3c2e
Split OpenAPI spec into individual files
Dec 4, 2023
a468d72
Added Operation Ids
michaelvanstraten Feb 29, 2024
5bbab24
Added basic GH action for linting OpenAPI spec
michaelvanstraten Feb 29, 2024
1431ecf
Basic test generation of python Client
michaelvanstraten Feb 29, 2024
653655d
Made ref file relative
michaelvanstraten Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/redocly-bundle/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: redocly bundle
description: "Bundle a multi-file API description to a single file."
inputs:
apis:
description: "List of API description root filenames or names assigned in the `apis` section of your Redocly configuration file. Default values are all names defined in the `apis` section within your configuration file."
required: true
output:
description: "Name or folder for the bundle file. If you don't specify the file extension, `.yaml` is used by default. If the specified folder doesn't exist, it's created automatically. If the file specified as the bundler's output already exists, it's overwritten."

runs:
using: "composite"
steps:
- uses: actions/setup-node@main
with:
node-version: 20
- name: install redocly
shell: bash
run: npm install @redocly/cli -g
- name: bundle openapi spec
shell: bash
run: |
redocly bundle ${{ inputs.apis }} ${{ inputs.output && '--output' }} ${{ inputs.output }}
47 changes: 47 additions & 0 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: BMO OpenAPI spec

on:
push:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
openapi

- name: bundle OpenAPI spec
uses: ./.github/actions/redocly-bundle
with:
apis: openapi/openapi.yaml
output: openapi/bundled.yaml

- name: install vacuum
run: npm i -g @quobix/vacuum

- name: run vacuum lint
run: vacuum lint openapi/bundled.yaml

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: bundle OpenAPI spec
uses: ./.github/actions/redocly-bundle
with:
apis: openapi/openapi.yaml
output: openapi/bundled.yaml

- name: Generate Python Client
uses: openapi-generators/[email protected]
with:
generator: python
openapi-file: openapi/bundled.yaml
command-args: --skip-validate-spec
# config-file: python-generator-config.yml
11 changes: 11 additions & 0 deletions .neoconf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"lspconfig": {
"yamlls": {
"yaml": {
"schemas": {
"https://json.schemastore.org/github-workflow.json": ".github/workflows/*.yml",
}
}
}
}
}
8 changes: 8 additions & 0 deletions openapi/components/parameters/BugIdOrAlias.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: id_or_alias
in: path
description: A single integer bug ID or alias.
required: true
schema:
type:
- string
- integer
56 changes: 56 additions & 0 deletions openapi/components/schemas/Attachment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
type: object
properties:
data:
description: The raw data of the attachment, encoded as Base64.
type: string
format: base64
size:
description: The length (in bytes) of the attachment.
type: integer
creation_time:
description: The time the attachment was created.
type: string
format: date-time
last_change_time:
description: The last time the attachment was modified.
type: string
format: date-time
id:
description: The numeric ID of the attachment.
type: integer
bug_id:
description: The numeric ID of the bug that the attachment is attached to.
type: integer
file_name:
description: The file name of the attachment.
type: string
summary:
description: A short string describing the attachment.
type: string
content_type:
description: The MIME type of the attachment.
type: string
is_private:
description: >-
``true`` if the attachment is private (only visible to a certain group
called the "insidergroup"), ``false`` otherwise.
type: boolean
is_obsolete:
description: '``true`` if the attachment is obsolete, ``false`` otherwise.'
type: boolean
is_patch:
description: '``true`` if the attachment is a patch, ``false`` otherwise.'
type: boolean
creator:
description: The login name of the user that created the attachment.
type: string
creator_detail:
description: An object containing detailed user information for the creator.
$ref: ./User.yaml
flags:
description: >-
Array of objects, each containing the information about the flag currently
set for each attachment.
type: array
items:
$ref: ./Flag.yaml
Loading