-
Notifications
You must be signed in to change notification settings - Fork 13k
feat: Add OpenAPI Support to oauth-apps.get API #36598
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
Changes from all commits
5234116
9128297
64a67b3
376d164
04c45ee
68baa5a
8ce9382
e9be5f2
05c8575
0b8a0a5
fad17fb
993e421
678092c
ba8b68f
9df5513
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@rocket.chat/meteor": patch | ||
| "@rocket.chat/core-typings": patch | ||
| "@rocket.chat/rest-typings": patch | ||
| --- | ||
|
|
||
| Add OpenAPI support for the Rocket.Chat oauth-apps.get API endpoints by migrating to a modern chained route definition syntax and utilizing shared AJV schemas for validation to enhance API documentation and ensure type safety through response validation. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -286,8 +286,9 @@ describe('[OAuthApps]', () => { | |
| .expect(400) | ||
| .expect((res) => { | ||
| expect(res.body).to.have.property('success', false); | ||
| expect(res.body).to.have.property('errorType', 'error-invalid-params'); | ||
| expect(res.body).to.have.property('error'); | ||
| expect(res.body.error).to.include('must be string').and.include('must match exactly one schema in oneOf [invalid-params]'); | ||
| expect(res.body.error).to.include('must be string').and.include('must match exactly one schema in oneOf'); | ||
|
Comment on lines
+289
to
+291
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error was |
||
| }); | ||
| }); | ||
|
|
||
|
|
@@ -311,8 +312,9 @@ describe('[OAuthApps]', () => { | |
| .expect(400) | ||
| .expect((res) => { | ||
| expect(res.body).to.have.property('success', false); | ||
| expect(res.body).to.have.property('errorType', 'error-invalid-params'); | ||
| expect(res.body).to.have.property('error'); | ||
| expect(res.body.error).to.include('must be string').and.include('must match exactly one schema in oneOf [invalid-params]'); | ||
| expect(res.body.error).to.include('must be string').and.include('must match exactly one schema in oneOf'); | ||
| }); | ||
| }); | ||
|
|
||
|
|
@@ -336,8 +338,9 @@ describe('[OAuthApps]', () => { | |
| .expect(400) | ||
| .expect((res) => { | ||
| expect(res.body).to.have.property('success', false); | ||
| expect(res.body).to.have.property('errorType', 'error-invalid-params'); | ||
| expect(res.body).to.have.property('error'); | ||
| expect(res.body.error).to.include('must be string').and.include('must match exactly one schema in oneOf [invalid-params]'); | ||
| expect(res.body.error).to.include('must be string').and.include('must match exactly one schema in oneOf'); | ||
| }); | ||
| }); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ export interface IOAuthApps { | |
| name: string; | ||
| active: boolean; | ||
| clientId: string; | ||
| clientSecret: string; | ||
| clientSecret?: string; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The IOAuthApps used in findOneAuthAppByIdOrClientId doesn’t include clientSecret, so I made it optional in the interface
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| redirectUri: string; | ||
| _createdAt: Date; | ||
| _createdBy: { | ||
|
|
||
This file was deleted.
This file was deleted.
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.
It was missing in the typedThis, so I added it.