Repository: freeCodeCamp/freeCodeCamp
File: api/src/schemas.ts (TypeScript)

Code before:
      200: Type.Object({ msUsername: Type.Null() }),
      500: Type.Object({
        message: Type.Literal('flash.ms.transcript.unlink-err'),
        type: Type.Literal('error')
      })
    }
  },
  // Deprecated endpoints:
  deprecatedEndpoints: {
    response: {
      410: Type.Object({
        message: Type.Object({
          type: Type.Literal('info'),
          message: Type.Literal(
            'Please reload the app, this feature is no longer available.'
          )
        })
      })
    }
  },
  // Challenges:
  projectCompleted: {
    body: Type.Object({
      id: Type.String({ format: 'objectid', maxLength: 24, minLength: 24 }),
      challengeType: Type.Optional(Type.Number()),
      // Solution does not need to be a valid URL unless it is NOT `backEndProject`
      solution: Type.String({ maxLength: 1024 }),
      githubLink: Type.Optional(Type.String())
    }),
    response: {
      200: Type.Object({
        // TODO(Post-MVP): delete completedDate and alreadyCompleted? As far as
        // I can tell, they are not used anywhere
        completedDate: Type.Number(),
        points: Type.Number(),
        alreadyCompleted: Type.Boolean()
      }),
      400: Type.Object({
        type: Type.Literal('error'),
        message: Type.Union([
          Type.Literal(
            'That does not appear to be a valid challenge submission.'
          ),
          Type.Literal(
            'You have not provided the valid links for us to inspect your work.'
          )
        ])
      }),
      403: Type.Object({
        type: Type.Literal('error'),
        message: Type.Union([

Review comment (suggestion):
```suggestion
      // The solution must be a valid URL only if it is a `backEndProject`.
```

Code after:
      200: Type.Object({ msUsername: Type.Null() }),
      500: Type.Object({
        message: Type.Literal('flash.ms.transcript.unlink-err'),
        type: Type.Literal('error')
      })
    }
  },
  // Deprecated endpoints:
  deprecatedEndpoints: {
    response: {
      410: Type.Object({
        message: Type.Object({
          type: Type.Literal('info'),
          message: Type.Literal(
            'Please reload the app, this feature is no longer available.'
          )
        })
      })
    }
  },
  // Challenges:
  projectCompleted: {
    body: Type.Object({
      id: Type.String({ format: 'objectid', maxLength: 24, minLength: 24 }),
      challengeType: Type.Optional(Type.Number()),
      // The solution must be a valid URL only if it is a `backEndProject`.
      solution: Type.String({ maxLength: 1024 }),
      githubLink: Type.Optional(Type.String())
    }),
    response: {
      200: Type.Object({
        // TODO(Post-MVP): delete completedDate and alreadyCompleted? As far as
        // I can tell, they are not used anywhere
        completedDate: Type.Number(),
        points: Type.Number(),
        alreadyCompleted: Type.Boolean()
      }),
      400: Type.Object({
        type: Type.Literal('error'),
        message: Type.Union([
          Type.Literal(
            'That does not appear to be a valid challenge submission.'
          ),
          Type.Literal(
            'You have not provided the valid links for us to inspect your work.'
          )
        ])
      }),
      403: Type.Object({
        type: Type.Literal('error'),
        message: Type.Union([