-
Notifications
You must be signed in to change notification settings - Fork 42
refactor: generate openapi directly instead of legacy format #482
Conversation
find a better place to define parameter examplesroutes/lib/endpoint/add-code-samples.js Lines 6 to 11 in 8f49c51
This comment was generated by todo based on a
|
handle optional preview blocksroutes/lib/endpoint/find-accept-header.js Lines 7 to 12 in 8f49c51
This comment was generated by todo based on a
|
put examples from docs in operationroutes/lib/endpoint/find-parameters.js Lines 276 to 281 in 8f49c51
This comment was generated by todo based on a
|
at present: PASS test/unit/options-urls-test.js 9 OK 818ms
PASS test/integration/landing-page-test.js 1 OK 1s
FAIL test/integration/endpoints-test.js 21s
Suites: 1 failed, 2 passed, 3 of 3 completed
Asserts: 378 failed, 634 passed, of 1012
Time: 21s current failures are primarily around operation sorting and |
const previewBlocks = state.blocks.filter(block => block.type === 'preview') | ||
|
||
state.routes.forEach(route => { | ||
// TODO: handle optional preview blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is obsolete and can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, there are 73 routes on api.github.com
that come through with previewBlocks
that have required: false
- https://developer.github.com/v3/apps/installations/#list-repositories
- https://developer.github.com/v3/issues/#list-issues
- https://developer.github.com/v3/orgs/#get-an-organization
- https://developer.github.com/v3/orgs/#edit-an-organization
- https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations
- https://developer.github.com/v3/orgs/members/#create-organization-invitation
- https://developer.github.com/v3/orgs/members/#list-organization-invitation-teams
- https://developer.github.com/v3/repos/#list-organization-repositories
- https://developer.github.com/v3/repos/#create
- https://developer.github.com/v3/teams/#list-teams
- https://developer.github.com/v3/teams/#create-team
- https://developer.github.com/v3/repos/#edit
- https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch
- https://developer.github.com/v3/repos/branches/#replace-team-restrictions-of-protected-branch
- https://developer.github.com/v3/repos/branches/#add-team-restrictions-of-protected-branch
- https://developer.github.com/v3/repos/branches/#remove-team-restrictions-of-protected-branch
- https://developer.github.com/v3/repos/collaborators/#list-collaborators
- https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator
- https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository
- https://developer.github.com/v3/repos/comments/#get-a-single-commit-comment
- https://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit
- https://developer.github.com/v3/repos/deployments/#list-deployments
- https://developer.github.com/v3/repos/deployments/#create-a-deployment
- https://developer.github.com/v3/repos/deployments/#get-a-single-deployment
- https://developer.github.com/v3/repos/deployments/#list-deployment-statuses
- https://developer.github.com/v3/repos/deployments/#create-a-deployment-status
- https://developer.github.com/v3/repos/deployments/#get-a-single-deployment-status
- https://developer.github.com/v3/issues/#list-issues-for-a-repository
- https://developer.github.com/v3/issues/#create-an-issue
- https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository
- https://developer.github.com/v3/issues/comments/#get-a-single-comment
- https://developer.github.com/v3/issues/events/#list-events-for-a-repository
- https://developer.github.com/v3/issues/events/#get-a-single-event
- https://developer.github.com/v3/issues/#get-a-single-issue
- https://developer.github.com/v3/issues/#edit-an-issue
- https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue
- https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue
- https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue
- https://developer.github.com/v3/issues/events/#list-events-for-an-issue
- https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue
- https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue
- https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue
- https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue
- https://developer.github.com/v3/issues/#lock-an-issue
- https://developer.github.com/v3/issues/timeline/#list-events-for-an-issue
- https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository
- https://developer.github.com/v3/issues/labels/#create-a-label
- https://developer.github.com/v3/issues/labels/#get-a-single-label
- https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone
- https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site
- https://developer.github.com/v3/repos/pages/#enable-a-pages-site
- https://developer.github.com/v3/repos/pages/#update-information-about-a-pages-site
- https://developer.github.com/v3/pulls/#list-pull-requests
- https://developer.github.com/v3/pulls/#create-a-pull-request
- https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository
- https://developer.github.com/v3/pulls/comments/#get-a-single-comment
- https://developer.github.com/v3/pulls/#get-a-single-pull-request
- https://developer.github.com/v3/pulls/#update-a-pull-request
- https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request
- https://developer.github.com/v3/pulls/review_requests/#create-a-review-request
- https://developer.github.com/v3/repos/#list-all-topics-for-a-repository
- https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository
- https://developer.github.com/v3/search/#search-issues-and-pull-requests
- https://developer.github.com/v3/search/#search-labels
- https://developer.github.com/v3/search/#search-repositories
- https://developer.github.com/v3/search/#search-topics
- https://developer.github.com/v3/teams/#get-team
- https://developer.github.com/v3/teams/#edit-team
- https://developer.github.com/v3/teams/#delete-team
- https://developer.github.com/v3/teams/discussions/#list-discussions
- https://developer.github.com/v3/teams/discussions/#create-a-discussion
- https://developer.github.com/v3/teams/discussions/#get-a-single-discussion
- https://developer.github.com/v3/teams/discussions/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for that long comment...the non-required accept headers for those routes are being ignored right now...after a cursory look, they seem to generally be used for adding extra info in the response...which if that's true, we could just always just get everything...but some analysis may be necessary to figure out exactly how to treat these, and even ensure if they're being parsed correctly as required: false
Make code samples respect parameter types and really just be less weirdroutes/lib/endpoint/add-code-samples.js Lines 77 to 82 in 36fa241
This comment was generated by todo based on a
|
Remove sorting (after openapi docs are regenerated by legacy-less algo)routes/test/integration/endpoints-test.js Lines 35 to 40 in 36fa241
This comment was generated by todo based on a
|
after part 2 commit:
|
Remove temporary workarounds that help gen the same OpenAPI docsroutes/lib/endpoint/overrides/workarounds.js Lines 82 to 87 in 840c761
This comment was generated by todo based on a
|
14 failures left that are not related to |
36 failures in |
only thing left is adding |
Don't override provided response descriptionsroutes/lib/endpoint/find-response.js Lines 90 to 95 in 3af64bd
This comment was generated by todo based on a
|
Only add content object if there's a response bodyroutes/lib/endpoint/find-response.js Lines 101 to 106 in 3af64bd
This comment was generated by todo based on a
|
kebab-case scoperoutes/lib/endpoint/html-to-json.js Lines 28 to 33 in 3af64bd
This comment was generated by todo based on a
|
present state of things:
looks like the test checks weren't triggered...at least there's no indication whether they passed or failed on the checks tab...not sure what to do about this...but it's ready for review @gr2m and just fyi...the gratuitous amounts of todos need not become issues...the important ones will be done in short order after this is merged...it's just helpful to know where in the code certain changes need to be made...some of them are effectively duplicates of existing issues |
3af64bd
to
50acbf0
Compare
Don't override provided response descriptionsroutes/lib/endpoint/find-response.js Lines 90 to 95 in 50acbf0
This comment was generated by todo based on a
|
Only add content object if there's a response bodyroutes/lib/endpoint/find-response.js Lines 101 to 106 in 50acbf0
This comment was generated by todo based on a
|
Don't override provided response descriptionsroutes/lib/endpoint/find-response.js Lines 90 to 95 in ff733a9
This comment was generated by todo based on a
|
Only add content object if there's a response bodyroutes/lib/endpoint/find-response.js Lines 101 to 106 in ff733a9
This comment was generated by todo based on a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 👍
🎉 This PR is included in version 21.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fixes #481
removing the legacy format entirely means adding/changing features will be done directly to the openapi document, instead of first modifying the legacy route format and then converting that to an openapi operation...a handful of issues will be quick to resolve once this is merged...the goal of this pr is to get to 100% tests passing without changing any openapi docs, just the doc generation algorithm