Skip to content
Discussion options

You must be logged in to vote

Hi Alexandr!

Passing options is a missing feature in oj_serializers that I'd like to add at some point (if I manage to do so without introducing performance regressions for the cases where options are not used).

In the meantime, you could try something like:

type "Price[]"
def prices
  PriceSerializer.many(object.prices, options)
end

And then create an app/frontend/types/Price.ts file where you re-export the generated type as a custom type:

import type { Price } from '~/types/serializers'

export type { Price as default }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by noxasch
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