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

Proposal: ability to remove fields in data structures #420

Open
v1adko opened this issue Mar 7, 2018 · 0 comments
Open

Proposal: ability to remove fields in data structures #420

v1adko opened this issue Mar 7, 2018 · 0 comments

Comments

@v1adko
Copy link

v1adko commented Mar 7, 2018

I think it would be beneficial in terms of structure reusability if there was a way to remove keys from schemas (data structures).

I'm defining request/response objects like data structures

## Model-create-request (object)
<!-- include(./create.md) -->

## Model-create-response (object)
<!-- include(./create-response.md) -->

And in files I have something like this:

base.md

a: 1 (number, required) - One
b: 2 (number, required) - Two

create.md

<!-- include(./base.md) -->
c: 3 (number, required) - Three
d: 4 (number, required) - Four

create-response.md

<!-- include(./create.md) -->
extra: extra (string, required) - Something extra
-d

So now I would expect to have a response object like this:

{
   a: 1,
   b: 2,
   c: 3,
   extra: "Extra"
}

However I have found no way to remove an object key that was already defined somewhere "on top".
You can overwrite d to other value (null, undefined), but not remove it completely.

Currently -d results in

d: ""

Thank you for consideration.
BTW - great work, I really enjoy using this standard!

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

2 participants