question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Embedded discriminator

See original GitHub issue

In polymorphic fields discrimintator(type field) and object are 2 separated fields. Is it possible somehow to embed the discriminator? To be possible

[
    { "type": "rectange", "width": 100, "height": 50 },
    { "type": "circle", "radius": 20 }
]

This will allow more cleaner json. discriminator-demo

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
cbeustcommented, Dec 22, 2018

Ah alright, thanks for the link. I can probably offer something similar in Klaxon.

Reopening.

0reactions
cbeustcommented, Dec 24, 2018

@raderio It should. Try it and let me know 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embedded Discriminators in Mongoose 4.8
Mongoose 4.8 adds the ability to create discriminators on embedded arrays. Discriminators for Document Arrays. In mongoose ~4.8 you can define a ...
Read more >
Mask-Embedded Discriminator With Region-Based Semantic ...
Toward this end, we propose a semi-supervised Generative Adversarial Network with a Mask-Embedded Discriminator, which is referred to as MED-GAN. By ...
Read more >
Nested discriminator with mongoose | by Doruk Güneş - Medium
Let's try to understand nested discriminators in mongoose with a ... We will cover why we decided to embed the blocks under the...
Read more >
Nested Discriminators - typegoose
Nested Discriminators may also be called "Embedded Discriminators". info. This Guide will use the assertion function that typegoose provides.
Read more >
Compound indexes on parent + embedded discriminators
It seems to be possible to add indexes to the embedded discriminator, and mongoose already nests them. Say I want to add a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found