Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

How to dereference, remove inherited key or override it as undefined #25

Open
netmilk opened this issue May 26, 2015 · 2 comments
Open

Comments

@netmilk
Copy link
Contributor

netmilk commented May 26, 2015

When I inherit or mix one type from some other type which contain someKey. How can I remove in the mixed or inherited object?

It's something equivalent to JS obj.key = undefined or delete obj.key

@honzajavorek
Copy link
Contributor

A hack could be probably to redefine it with optional, but haven't tried it.

@netmilk netmilk changed the title How to dereference or remove inherited key How to dereference, remove inherited key or override it as undefined Jun 18, 2015
@maranomynet
Copy link

+1 Exclude keyword is sorely needed - or a null/undefined type.

optional doesn't really capture it, so I've used a workaround similar to this:

# Data Structures

## Comment_Bare  (object)
+ body (string)
+ author (string)

## Comment  (Comment_Bare)
+ id (string)
+ date_posted (string)

And then the POST Action uses Comment_Bare as playload, while the GET Action returns a full Comment object. It feels like a kludge.

Instead I'd like to define the POST Action playload to be Comment - but Excluding id and date_posted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants