mathematic-inc / ts-japi

A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification
Apache License 2.0
205 stars 16 forks source link

looking for option to customize few things #55

Closed sunnybogawat closed 7 months ago

sunnybogawat commented 2 years ago

I am looking for some customization for the serialized response

egmacke commented 2 years ago

Hi @sunnybogawat.

Most (if not all) of your customisations can be achieved using the SerializerOptions argument when invoking the serializer.

How I can remove the JSON API version from the output?

SerializerOption: version: null - Setting this to null will omit the version

Is it possible to exclude data in the Relator and only keep the links?

Could you give a fuller example of exactly what it is you want to achieve here?

How I can exclude the include section from the serialized output

If you mean the included section, then this should not be present unless you're explicitly requsting it using either the depth or include SerializerOption fields.

Hope that helps