You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The quicktype output when generating go code is incorrect and uncompilable due to it not correctly adding all the imports to the top of the file when setting leadingComments.
Context (Environment, Version, Language)
Input Format: JSON Schema
Output Language: Go
CLI, npm, or app.quicktype.io: npm (quicktype-core)
Version: v23.0.170
Description
I am trying to create a set of types in a single go file by adding multiple JSON schemas together.
Input Data
constgeoSchema={id: 'http://json-schema.org/geo',$schema: 'http://json-schema.org/draft-06/schema#',description: 'A geographical coordinate',type: 'object',properties: {longitude: {type: 'number',},},};constblogPostSchema={$id: 'https://example.com/blog-post.schema.json',$schema: 'https://json-schema.org/draft/2020-12/schema',description: 'A representation of a blog post',type: 'object',properties: {publishedDate: {type: 'string',format: 'date-time'},},};
Issue Type
The quicktype output when generating go code is incorrect and uncompilable due to it not correctly adding all the imports to the top of the file when setting
leadingComments
.Context (Environment, Version, Language)
Input Format: JSON Schema
Output Language: Go
CLI, npm, or app.quicktype.io:
npm
(quicktype-core
)Version:
v23.0.170
Description
I am trying to create a set of types in a single go file by adding multiple JSON schemas together.
Input Data
Expected Behaviour / Output
Current Behaviour / Output
Notice how the
import "time"
is in the middle of the file which is invalid in go.Steps to Reproduce
Possible Solution
Looks like potentially this line is wrong
quicktype/packages/quicktype-core/src/language/Golang/GolangRenderer.ts
Line 525 in 29bb816
leadingComments
is not set toundefined
The text was updated successfully, but these errors were encountered: