Skip to content

json scheme to Cpp, enum has no origin order #1289

Description

@GeneKong

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions