Skip to content

Conversation

@nduitz
Copy link

@nduitz nduitz commented Sep 10, 2025

Hey there.

We have a lot of polymorphic relations in our project which leads to very unreadable errors when asserting the api spec in tests.

Since we model the jsonapi standard in our schemas every resource has a "type".

I know this problem is very specific to our use case, but extending the enum error by expected and given would make our lives way better <3


defstruct reason: nil,
value: nil,
enum: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding a new enum field which is specific to enum schemas, to the error struct, I suggest using meta like many other kinds of errors in the same module.

defstruct reason: nil,
value: nil,
enum: [],
format: nil,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also update the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants