We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello Jairus
Thank you for amazing library 🔥
Unfortunatelly I reproduced trailing comma issue .
import {JSON} from "json-as"; @json export class ItemPluginsBasket { @alias("catalog_id") catalogId!: string; @alias("catalog_item_id") catalogItemId!: string; @alias("outlet_id") outletId!: string; } @json export class ItemPlugins { @omitnull() basket!: ItemPluginsBasket | null; } @json export class Item { id!: string; @omitnull() plugins!: ItemPlugins | null; } export function example(): void { const s: Item = { id: "1", plugins: { basket: { catalogId: "1", catalogItemId: "2", outletId: "3" } } }; const outputStr = JSON.stringify<Item>(s); console.log(outputStr); }
Output
{"id":"1","plugins":{"basket":{"catalog_id":"1","catalog_item_id":"2","outlet_id":"3"},}}
If I add some dummy property it produces valid json
@json export class EmptyObject { } @json export class ItemPlugins { @omitnull() basket!: ItemPluginsBasket | null; dummy!: EmptyObject | null; }
Related to #26
The text was updated successfully, but these errors were encountered:
@snaffl, thanks you! I'll fix this in a moment. Either in the upcoming v1.0 release or a patch release
v1.0
Sorry, something went wrong.
Also sorry I forgot about your previous issue, I didn't mean to close it
566ad98
JairusSW
No branches or pull requests
Hello Jairus
Thank you for amazing library 🔥
Unfortunatelly I reproduced trailing comma issue .
Output
If I add some dummy property it produces valid json
Related to #26
The text was updated successfully, but these errors were encountered: