glideapps / glideapps/quicktype

optional fields missing when input file is json schema (to typescript & c# tested)

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

Description

# Description

when trying to convert json schema of docker compose spec to typescript or c#, an object with only empty interfaces as members is generated. If they are optional (which they truly are), i would expect them to be there as optional, filled interfaces with members. i tried with another tool on the internet (https://transform.tools/json-schema-to-typescript) and the output was as expected.

## Reproduce:

- paste docker compose json schema as input (https://raw.githubusercontent.com/docker/compose/master/compose/config/config_schema_compose_spec.json)

- choose typescript or c# as output

- output is only empty interfaces

### example output from quicktype.io

/**
* The Compose file is a YAML file defining a multi-containers based application.
*/
export interface Coordinate {
configs?: Configs;
networks?: { [key: string]: any };
secrets?: Secrets;
services?: Services;
/**
* Version of the Compose specification used. Tools not implementing required version MUST
* reject the configuration file.
*/
version?: string;
volumes?: Volumes;
}

export interface Configs {
}

export interface Secrets {
}

export interface Services {
}

export interface Volumes {
}

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.