Title: Parsing UUIDs in Handlers with Effect Typescript Library

I'd like to have my IDs be UUIDs. How can I make it easy to parse them in handlers?

export const idParam = HttpApiSchema.param('id', Schema.UUID)

const mediaGroupImplementation = HttpApiBuilder.group(
  api,
  'media',
  (handlers) =>
    handlers
      .handle('getJobResult', ({ path: { id } }) => getJobResultHandler(id)),
// ----------------------------------------------------------------------^ Argument of type 'string' is not assignable to parameter of type 'UUID'.ts(2345)
)


Do I have to create something like Schema.NumberFromString but UuidFromString?
Was this page helpful?