Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Built-in codes expose stable fields suitable for application logic, logging, API

```json
{
"id" : "kiit.CONFLICT",
"name" : "CONFLICT",
"group" : "Rejected",
"origin" : "kiit",
Expand Down Expand Up @@ -170,8 +169,8 @@ import kiit.codes.*

val grpc = CodesToGrpc()

grpc.toCode(Restricted.DENIED) // 7
grpc.toStatus(9)?.name // "PRECONDITION_FAILED"
grpc.toCode(Restricted.DENIED) // 7, PERMISSION_DENIED
grpc.toStatus(6)?.name // "CONFLICT", ALREADY_EXISTS reversed
```

The mapping abstraction is not limited to HTTP and gRPC. `CodeLookup` and `CompositeLookup` can be used to define or extend mappings for other protocols.
Expand Down Expand Up @@ -238,7 +237,7 @@ See [GitHub Issues](https://github.com/slatekit/kiit-codes/issues) for current w
## Requirements

- Kotlin Multiplatform
- JVM, Android, JS (IR), iOS (arm64, simulator arm64, x64)
- JVM, Android, iOS (simulator, iosArm64, x64)
- No external runtime dependencies

## Contributing
Expand Down
Binary file modified assets/kiit-codes-custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/kiit-codes-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/kiit-codes-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/kiit-codes-protocols.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/kiit-codes-taxonomy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/kiit-codes-usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions kiit-codes/src/commonTest/kotlin/kiit/codes/CheckedTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CheckedTest {
} else {
Checked.failure(
Invalid.INVALID_VALUE,
listOf(Err.on("phone", "too short")),
listOf(Err.on("phone", phone, "Too short")),
)
}
}
Expand All @@ -39,7 +39,7 @@ class CheckedTest {
assertTrue(!checked.isValid)
assertEquals(Invalid.INVALID_VALUE, checked.status)
assertEquals(1, checked.errors.size)
assertEquals("too short", checked.errors.single().message)
assertEquals("Too short", checked.errors.single().message)
}

@Test
Expand Down
Loading