Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

feat(api-docs): Teams APIs in OpenAPI 3 - #1

Merged
manuzope merged 11 commits into
masterfrom
teams-schema
Aug 25, 2020
Merged

manuzope merged 11 commits into
masterfrom
teams-schema

Conversation

@manuzope

@manuzope manuzope commented Aug 20, 2020 •

Copy link
Copy Markdown
Contributor

This PR does a few things:

  • Add a Makefile to make development easier
    • yarn test tests all the examples in the swagger files
  • Adds teams endpoints (with scopes and examples for every 2xx case)
  • Adds authentication docs
  • Adds tests through a mapping file

Primarily want to lay out the structure through this PR.

We also need to add some json linting that I haven't added yet. And we need to run yarn test as a check. Will do these in a follow up PR.

}
}
},
"TeamProjects": {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Haven't figured out how to use Projects inside TeamProjects yet.

@manuzope manuzope changed the title Teams APIs in Swagger feat(api-docs): Teams APIs in OpenAPI 3 Aug 20, 2020
Comment thread Makefile Resolved
@manuzope
manuzope marked this pull request as ready for review August 20, 2020 18:46
@manuzope
manuzope requested a review from a team August 21, 2020 18:58
Comment thread paths/teams/index.json
"$ref": "../../components/schemas/team.json#/TeamWithProjects"
}
},
"example": [{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I feel like we should $ref the examples too maybe like examples/teams/team-with-projects-200.json or something? Then they could also be used in tests, I'm assuming we'd want the same info

@manuzope

Copy link
Copy Markdown
Contributor Author

Ideas for improvements

Notes from conversation with @MeredithAnya:

  1. We want some way to automate the tests. We have a few ideas here
    1. Write actual tests (with a setup and teardown) for each endpoint in this repo
    2. Have x-test-pre and x-test-post for each endpoint to automatically run against an org in sentry.io
  2. Maybe we should change the component file structure to be:
    option 1:
    /components
      /organizations
        /schemas
          index.json
          status.json
      /projects
        /schemas
          index.json
    
    option 2:
    /components
      /schemas
        /team
          index.json
          teamwithproject.json
          teamminmal.json
    
    Here, we're trying to prevent one file from getting too big and unreadable.
  3. Make examples into $refs so that the endpoint json doesn't get too large.
  4. Maybe we'll need to make examples constructible so that if you change event.json, you don't have to change a WHOLELOTOFTHINGS

@MeredithAnya MeredithAnya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some minor things but overall LGTM

Comment thread components/schemas/avatar.json Outdated
"example":"letter_avatar"
},
"avatarUuid": {
"type":"string",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: sometimes you have space after : and sometimes you don't

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea, it's from when I convert using different json formatters. We need a linter. Let me look into adding a pre-commit after this PR. But I'll fix it up here.

Comment thread components/schemas/project.json Resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants