quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

json scheme to Cpp, enum has no origin order

Open GeneKong opened this issue 5 years ago • 2 comments

We want enum with json order input as, but after we give input source:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Test",
    "type": "object",
    "properties": {
        "errorCode": {
            "type": "string",
            "enum": [
                "B",
                "A",
                "E"
            ]
        }
    }
}

but I always get like this:

enum class ErrorCode : int { A, B, E };

    class Test {
        public:
        Test() = default;
        virtual ~Test() = default;

we use this command:

quicktype -l c++ --code-format with-getter-setter --wstring use-string --const-style west-const --type-style pascal-case --member-style camel-case --enumerator-style pascal-case --no-boost -s schema test.json

GeneKong avatar Aug 14 '19 04:08 GeneKong

Hi, I met the same problem. Did you find any solution? :(

StephanXu avatar Apr 14 '21 13:04 StephanXu

This issue still exists, any updates?

patrickdejong avatar Sep 21 '23 07:09 patrickdejong