这是indexloc提供的服务,不要输入任何密码
Skip to content

Generate JSON Schema from Golang structs #817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

Schniz
Copy link

@Schniz Schniz commented Mar 3, 2022

This PR continues the amazing work done in #634 and #726.

Instead of generating the JSON schema from a separate TypeScript file, this commit introduces a new CLI (to avoid bloating the main one) that will output a JSON schema from the struct definition itself, including the actual code comments.

This will allow to better integration and to avoid differences between the two codebases.

This commit continues the amazing work done in #634 and #726.

Instead of generating the JSON schema from a separate TypeScript file,
this commit introduces a new CLI (to avoid bloating the main one) that
will output a JSON schema from the struct definition itself, including
the actual code comments.

This will allow to better integration and to avoid differences between
the two codebases.
@Schniz Schniz self-assigned this Mar 3, 2022
@vercel
Copy link

vercel bot commented Mar 3, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/vercel/turbo-site/AEf4R7jeap9iFFaSDTSfgMSmJcQb
✅ Preview: Failed

[Deployment for eb78732 failed]

@Schniz
Copy link
Author

Schniz commented Mar 3, 2022

Oh.

cli:schema: CGO_ENABLED=0 go build -o schema-generation.exe "-ldflags=-s -w" -trimpath ./cmd/schema-generation
cli:schema: /bin/sh: go: command not found
cli:schema: make: *** [schema-generation] Error 127

Not sure that we want to install golang to make this work.

@jaredpalmer
Copy link
Contributor

Let’s ponder hosting of the schema on .org in our 1:1

@Schniz
Copy link
Author

Schniz commented Mar 16, 2022

Add discussed, we should investigate whether we want to make it a build artifact that will be rewritten to in the website 😄

@jaredpalmer
Copy link
Contributor

@Schniz what's your suggestion on how to deal with versioning the schema?

@gaspar09 gaspar09 closed this May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants