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

(ExperimentClient Controller) Error code swagger updates and 401 auth error for invalid JWT token #1740

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ interface IExperimentAssignment {
/**
* @swagger
* tags:
* - name: Client Side SDK
* - name: Client API calls
* description: CRUD operations related to experiments points
*/

Expand Down Expand Up @@ -155,14 +155,23 @@ export class ExperimentClientController {
* example: instructor1
* description: ExperimentUser
* tags:
* - Client Side SDK
* - Client API calls
* produces:
* - application/json
* responses:
* '200':
* description: Set Group Membership
* schema:
* $ref: '#/definitions/initResponse'
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: Internal Server Error
*
*/
@Post('init')
public async init(
Expand Down Expand Up @@ -247,8 +256,14 @@ export class ExperimentClientController {
* description: Set Group Membership
* schema:
* $ref: '#/definitions/initResponse'
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: null value in column "id" of relation "experiment_user" violates not-null constraint
* description: Internal Server Error
*/
@Post('groupmembership')
public async setGroupMemberShip(
Expand Down Expand Up @@ -310,8 +325,14 @@ export class ExperimentClientController {
* description: Set Group Membership
* schema:
* $ref: '#/definitions/initResponse'
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: null value in column "id" of relation "experiment_user" violates not-null constraint
* description: Internal Server Error
*/
@Post('workinggroup')
public async setWorkingGroup(
Expand Down Expand Up @@ -413,8 +434,14 @@ export class ExperimentClientController {
* - enrollmentCode
* - userId
* - condition
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: User not defined
* description: Internal Server Error
*/
@Post('mark')
public async markExperimentPoint(
Expand Down Expand Up @@ -529,10 +556,14 @@ export class ExperimentClientController {
* - conditionCode
* - assignmentWeight
* - order
* '500':
* description: null value in column "id" of relation "experiment_user" violates not-null constraint
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment user not defined
* description: Experiment User not defined
* '500':
* description: Internal Server Error
*/
@Post('assign')
public async getAllExperimentConditions(
Expand Down Expand Up @@ -631,8 +662,14 @@ export class ExperimentClientController {
* responses:
* '200':
* description: Log data
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: null value in column "id\" of relation \"experiment_user\" violates not-null constraint
* description: Internal Server Error
*/
@Post('log')
public async log(
Expand Down Expand Up @@ -670,9 +707,15 @@ export class ExperimentClientController {
* - application/json
* responses:
* '200':
* description: Log data
* description: Log Caliper data
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: null value in column "id\" of relation \"experiment_user\" violates not-null constraint
* description: Internal Server Error
*/
@Post('log/caliper')
public async caliperLog(
Expand Down Expand Up @@ -727,6 +770,14 @@ export class ExperimentClientController {
* responses:
* '200':
* description: Log blob data
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: Internal Server Error
*/
@Post('bloblog')
public async blobLog(@Req() request: express.Request): Promise<any> {
Expand Down Expand Up @@ -796,8 +847,14 @@ export class ExperimentClientController {
* responses:
* '200':
* description: Client side reported error
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: null value in column "id\" of relation \"experiment_user\" violates not-null constraint
* description: Internal Server Error
*/
@Post('failed')
public async failedExperimentPoint(
Expand Down Expand Up @@ -852,6 +909,14 @@ export class ExperimentClientController {
* responses:
* '200':
* description: Feature flags list
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: Internal Server Error
*/
@Post('featureflag')
public async getAllFlags(
Expand Down Expand Up @@ -886,6 +951,10 @@ export class ExperimentClientController {
* responses:
* '200':
* description: Filtered Metrics
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '500':
* description: Insert error in database
*/
Expand Down Expand Up @@ -962,8 +1031,14 @@ export class ExperimentClientController {
* originalUser:
* type: string
* minLength: 1
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '404':
* description: Experiment User not defined
* '500':
* description: null value in column "id\" of relation \"experiment_user\" violates not-null constraint
* description: Internal Server Error
*/
@Post('useraliases')
public async setUserAliases(
Expand Down Expand Up @@ -1008,6 +1083,10 @@ export class ExperimentClientController {
* responses:
* '200':
* description: Database cleared
* '400':
* description: BadRequestError - InvalidParameterValue
* '401':
* description: AuthorizationRequiredError
* '500':
* description: DEMO mode is disabled
*/
Expand Down
Loading
Loading