Coder Social home page Coder Social logo

Comments (6)

michaelklishin avatar michaelklishin commented on September 15, 2024

This was fixed in several places before,
returning an empty array is possible.

On 21 oct 2015, at 12:40, Steffen Dienst [email protected] wrote:

If I create a dynamic shovel via pushing to /api/parameters/shovel with a publish-properties attribute like this

curl -i -u guest:guest -H "content-type:application/json" -XPUT
-d'{"value":{"dest-exchange":"amq.direct","src-queue":"test","dest-uri":"amqp://", "src-uri":"amqp://","publish-properties":{"user_id":"guest"}}}'
http://localhost:15672/api/parameters/shovel/%2f/test1
I can see at /api/parameters/shovel/%2f/test1 that the attribute publish-properties is a JSON object. If I instead create a queue with an empty publish-properties like

curl -i -u guest:guest -H "content-type:application/json" -XPUT
-d'{"value":{"dest-exchange":"amq.direct","src-queue":"test","dest-uri":"amqp://", "src-uri":"amqp://","publish-properties":{}}}'
http://localhost:15672/api/parameters/shovel/%2f/test1
the data type of this field is a JSON array instead. Is it possible to either not show the property or use an empty object?


Reply to this email directly or view it on GitHub.

from rabbitmq-management.

smee avatar smee commented on September 15, 2024

You mean only an empty array? Not an empty object?

from rabbitmq-management.

michaelklishin avatar michaelklishin commented on September 15, 2024

An empty object, sorry. The issue here is that proplists are lists in Erlang and so empty proplists are serialised as empty lists unless mochijson2 is instructed otherwise.

On 21 oct 2015, at 12:49, Steffen Dienst [email protected] wrote:

You mean only an empty array? Not an empty object?


Reply to this email directly or view it on GitHub.

from rabbitmq-management.

michaelklishin avatar michaelklishin commented on September 15, 2024

This belongs to shovel-management but lets keep it here.

from rabbitmq-management.

michaelklishin avatar michaelklishin commented on September 15, 2024

We've evaluated this and there is an issue with Erlang JSON libraries prior to 17.x: they use lists to express what is objects in JSON. So we can't reliably tell an empty list from an empty object. In master we will switch to maps. For 3.6.x, we will look at what we can do.

from rabbitmq-management.

essen avatar essen commented on September 15, 2024

Just sent two PRs with a proposal for a fix for this on stable. It's dirty really, and I have not run the full test suites to make sure I didn't break anything. Looking to see if that sort of fix is OK.

from rabbitmq-management.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.