PascalCase enum members in REST API responses#2323
Conversation
| {ccf::State::readingPublicLedger, "readingPublicLedger"}, | ||
| {ccf::State::readingPrivateLedger, "readingPrivateLedger"}, | ||
| {ccf::State::verifyingSnapshot, "verifyingSnapshot"}}) | ||
| {{ccf::State::uninitialized, "Uninitialized"}, |
There was a problem hiding this comment.
should this be ccf::State::UNINITIALIZED, "Uninitialized"?
There was a problem hiding this comment.
I'm not changing any C++ enum names in this PR, just serialization. But yes, this should eventually be changed.
|
|
||
| ### Changed | ||
|
|
||
| - Enum values returned by built-in REST API endpoints are now PascalCase (#2152). |
There was a problem hiding this comment.
The public Python API has been updated to use all-caps enums, that should be mentioned too.
There was a problem hiding this comment.
It's actually the same, only the values are updated, but the enum names are the same.
|
letmaik/PascalCase4JsonEnums@20765 aka 20210316.42 vs main ewma over 20 builds from 20233 to 20742 |
| PASSED = 1 | ||
| PENDING = 0 | ||
| REJECTED = -1 | ||
| STATE_ACTIVE = "ACTIVE" |
| OPEN = "Open" | ||
| ACCEPTED = "Accepted" | ||
| WITHDRAWN = "Withdrawn" | ||
| REJECTED = "Rejected" | ||
| FAILED = "Failed" |
There was a problem hiding this comment.
None of the other Python enum names have changed, only this one. If we're not touching the code names, only the values, the left hands here should be reverted.
There was a problem hiding this comment.
Hm, I didn't want to change C++ enums but Python test code seems ok? Is there anything that could break?
There was a problem hiding this comment.
Its harmless, just seems odd to do a partial consistency fix so I assumed it was a mistake.
There was a problem hiding this comment.
I fixed the ones that are in sync with C++. There are some local ones which I didn't touch.
… into letmaik/PascalCase4JsonEnums

Fixes #2152.