Skip to content

Commit

Permalink
chore: add OAS doc annotation
Browse files Browse the repository at this point in the history
Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>
  • Loading branch information
Pat Losoponkul committed Nov 9, 2023
1 parent b92f5ec commit 78f8f95
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
package io.iohk.atala.iam.wallet.http.model

import io.iohk.atala.api.http.Annotation
import sttp.tapir.*
import sttp.tapir.Schema.annotations.{description, encodedExample, validate}
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, JsonDecoder, JsonEncoder}

import java.util.UUID

// TODO: annotate
final case class CreateWalletUmaPermissionRequest(
@description(CreateWalletUmaPermissionRequest.annotations.subject.description)
@encodedExample(CreateWalletUmaPermissionRequest.annotations.subject.example)
subject: UUID
)

object CreateWalletUmaPermissionRequest {
given encoder: JsonEncoder[CreateWalletUmaPermissionRequest] = DeriveJsonEncoder.gen
given decoder: JsonDecoder[CreateWalletUmaPermissionRequest] = DeriveJsonDecoder.gen
given schema: Schema[CreateWalletUmaPermissionRequest] = Schema.derived

object annotations {
object subject
extends Annotation[UUID](
description =
"The subject ID that should be granted the permission to the wallet. This can be found in the `sub` claim of a JWT token.",
example = UUID.fromString("00000000-0000-0000-0000-000000000000")
)
}
}

0 comments on commit 78f8f95

Please sign in to comment.