Giter Site home page Giter Site logo

Comments (5)

jeffmendoza avatar jeffmendoza commented on June 27, 2024

The configs are defined as go structs: https://github.com/ossf/allstar/blob/main/pkg/config/config.go#L33-L67

Do you know of any tools that can generate a schema from those?

from allstar.

yu-iskw avatar yu-iskw commented on June 27, 2024

@jeffmendoza It seems that I found a couple of tools/packages to generate a OpenAPI JSON schema from golang types. But, I haven't looked into them whether or not they support JSON schema 7.

from allstar.

yu-iskw avatar yu-iskw commented on June 27, 2024

@jeffmendoza We found another package looks nicer than what I shared before.

from allstar.

yu-iskw avatar yu-iskw commented on June 27, 2024

@jeffmendoza I did't find any tool to generate a JSON schema from the struct types, which follows the draft-7 specification of JSON schema.

  1. Generate the base JSON schema with go-jsonschema-generator
  2. Ask ChatGPT to convert it to follow the draft-7 spec.
  3. Manually remove something like required properties in the JSON schema

https://github.com/yu-iskw/allstar-jsonschema/blob/main/allstar-config.json

from allstar.

yu-iskw avatar yu-iskw commented on June 27, 2024

I figured out there is no perfect existing tool to generate JSON schemas from the definitions in golang. After all, I took advantage of ChatGPT to generate the JSON schemas.

https://github.com/yu-iskw/allstar-jsonschema

from allstar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.