Skip to content

UUID shapes? #262

Answered by Baccata
Quafadas asked this question in Q&A
Jun 10, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

I guess I was hoping that UUID was somehow built in. Is the canonical strategy here to have a string,

Well you're in luck, because we make use of UUID types heavily internally so we decided to add first class support for it.

use smithy4s.api#UUID

structure EventId {
  @httpLabel
  @required
  name:UUID
}

the name field gets rendered as a java.util.UUID. If you want newtype UUIDs, you can do :

use smithy4s.api#uuidFormat

@uuidFormat 
string MyUUID 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Quafadas
Comment options

Answer selected by Quafadas
Comment options

You must be logged in to vote
1 reply
@Quafadas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants