Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #979
Closed
Open
Issue created May 05, 2019 by Yann Büchau@nobodyinperson

Renaming an object key

Currently, it is not possible to rename an object key efficiently. However, renaming an object key can be handy at times.

For example, I am currently implementing a Json-RPC library. The library also provides a server class which processes Json-RPC requests (a JsonVariant) and calls appropriate callback methods which in turn fill a Json-RPC response (also a JsonVariant). Depending on the success of the callback, either the "result" member or the "error" member must be filled according to the specification. If renaming object keys would be possible with ArduinoJson, the callbacks could just care about filling a JsonVariant with a result or an error object and the server would take care of choosing the right key name depending on the callback's success. Currently, the callbacks need to be aware of the Json-RPC specification which I consider a rather clumsy style.

This is just my use case of renaming object keys but I am sure other people would also benefit from this feature.

BTW Thank you so much for this awesome library! :-)

Yann

Assignee
Assign to
Time tracking