Skip to content
New issue

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

Disapperaing properties with empty string as value #1831

Open
EnocMartinez opened this issue Dec 1, 2023 · 2 comments
Open

Disapperaing properties with empty string as value #1831

EnocMartinez opened this issue Dec 1, 2023 · 2 comments

Comments

@EnocMartinez
Copy link

Not sure if this is a feature or a bug, but the FROST-Server (I'm using docker v2.3) erases all properties with empty strings as value. For example, I post the following Thing:

{
  "name" : "Kitchen",
  "description" : "The Kitchen in my house",
  "properties" : {
    "someProperty" : true,
    "emptyProperty": ""
  }
}

And when I do a query, the emptyProperty field is missing:

{
  "name" : "Kitchen",
  "description" : "The Kitchen in my house",
  "properties" : {
    "someProperty" : true
  }
}

However, the emptyProperty is indeed in the database:

{
  "someProperty": true,
  "emptyProperty": ""
}

I check the standard and I couldn't find any mention to empty properties. Is this behavior intended?

@hylkevds
Copy link
Member

hylkevds commented Dec 1, 2023

That behaviour is not explicitly specified. It's simply the default behaviour of (most) json libraries, to leave out empty strings.
That could probably be made into a configuration option.

@EnocMartinez
Copy link
Author

An option to control this behavior would be much appreciated, thanks

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

No branches or pull requests

2 participants