glideapps / glideapps/quicktype

Incorrect description merging

Open
#1,582 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
13.9k
Forks
1.2k
Avg merge
8h 53m
Merged PRs (30d)
369

Description

Using the following json-schema input:

```json
{
"$defs": {
"name": {
"type": "string",
"description": "name description"
},
"surname": {
"type": "string",
"description": "surname description"
}
},
"type": "object",
"properties": {
"name": {
"$ref": "#/$defs/name"
},
"surname": {
"$ref": "#/$defs/surname"
}
}
}
```

I get this output:

```json
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Coordinate",
"definitions": {
"Coordinate": {
"type": "object",
"additionalProperties": {},
"properties": {
"name": {
"type": "string",
"description": "name description\nsurname description"
},
"surname": {
"type": "string",
"description": "name description\nsurname description"
}
},
"required": [],
"title": "Coordinate"
}
}
}
```

The two description fields are incorrectly combined.

https://app.quicktype.io?share=TMZroOOQW4DAdf2qgsxS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.