Skip to content

--density normal causes comments to be suppressed (Swift) #688

Description

@rjstelling

Using the CLI and passing the --density normal switch causes the suppression of comments when the source language is JSON Schema.

Example Schema

{
    "$ref": "#/definitions/ServerCommunication",
    "$schema": "http://json-schema.org/draft-06/schema#",
    "definitions": {
        "ServerCommunication": {
            "additionalProperties": false,
            "properties": {
                "msg_for_user": {
                    "description": "A message to be displayed to the user. Human readable, English",
                    "type": "string"
                },
                "server_error": {
                    "description": "A human readable error message",
                    "type": "string"
                },
                "status_code": {
                    "description": "Error code returned from the server",
                    "type": "integer"
                }
            },
            "required": [
                "msg_for_user",
                "server_error",
                "status_code"
            ],
            "title": "server_communication",
            "type": "object"
        }
    }
}

Command 1 (produces Swift with comments):
"--alphabetize-properties" "--no-initializers" "--src" "ServerCommunication.schema" "--src-lang" "schema" "--lang" "swift" "--top-level" "ServerCommunication" -o "ServerCommunication.swift"

Command 2 (produces Swift without comments):
"--alphabetize-properties" "--no-initializers" "--density" "normal" "--src" "ServerCommunication.schema" "--src-lang" "schema" "--lang" "swift" "--top-level" "ServerCommunication" -o "ServerCommunication.swift"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions