Repository: freeCodeCamp/freeCodeCamp
File: api/src/schemas/users/get-public-profile.ts (TypeScript)

Code before:
                  id: Type.String(),
                  completedDate: Type.Number()
                })
              ),
              picture: Type.String(),
              // TODO(Post-MVP): points should be a number
              points: Type.Union([Type.Number(), Type.Null()]),
              portfolio: Type.Array(
                Type.Object({
                  description: Type.String(),
                  id: Type.String(),
                  image: Type.String(),
                  title: Type.String(),
                  url: Type.String()
                })
              ),
              profileUI,
              twitter: Type.Optional(Type.String()),
              website: Type.Optional(Type.String()),
              yearsTopContributor: Type.Array(Type.String()), // TODO(Post-MVP): convert to number?
              joinDate: Type.String(),
              savedChallenges: Type.Array(savedChallenge),
              username: Type.String(),
              usernameDisplay: Type.Optional(
                Type.Union([Type.String(), Type.Null()])
              ),
              msUsername: Type.Optional(Type.String())
            })
          ])
        )
      }),
      result: Type.String()
    }),
    // We can't simply have Type.Object({}), even though that's correct, because
    // TypeScript will then accept all responses (since every object can be
    // assigned to {})
    400: Type.Union([
      Type.Object({ entities: Type.Optional(Type.Never()) }),
      Type.Literal(
        'This endpoint is no longer available outside of the freeCodeCamp ecosystem'
      )
    ]),
    404: Type.Object({ entities: Type.Optional(Type.Never()) })
  }
};


Review comment (suggestion):
```suggestion
              usernameDisplay: Type.String(),
```

Code after:
                  id: Type.String(),
                  completedDate: Type.Number()
                })
              ),
              picture: Type.String(),
              // TODO(Post-MVP): points should be a number
              points: Type.Union([Type.Number(), Type.Null()]),
              portfolio: Type.Array(
                Type.Object({
                  description: Type.String(),
                  id: Type.String(),
                  image: Type.String(),
                  title: Type.String(),
                  url: Type.String()
                })
              ),
              profileUI,
              twitter: Type.Optional(Type.String()),
              website: Type.Optional(Type.String()),
              yearsTopContributor: Type.Array(Type.String()), // TODO(Post-MVP): convert to number?
              joinDate: Type.String(),
              savedChallenges: Type.Array(savedChallenge),
              username: Type.String(),
              usernameDisplay: Type.String(),
              msUsername: Type.Optional(Type.String())
            })
          ])
        )
      }),
      result: Type.String()
    }),
    // We can't simply have Type.Object({}), even though that's correct, because
    // TypeScript will then accept all responses (since every object can be
    // assigned to {})
    400: Type.Union([
      Type.Object({ entities: Type.Optional(Type.Never()) }),
      Type.Literal(
        'This endpoint is no longer available outside of the freeCodeCamp ecosystem'
      )
    ]),
    404: Type.Object({ entities: Type.Optional(Type.Never()) })
  }
};