INNER CODE UNIT · Go

main

stacklok/toolhive · cmd/help/openapi-normalize/main.go:42

func main() {
	if len(os.Args) != 4 {
		fmt.Fprintln(os.Stderr, "usage: openapi-normalize <input.json|yaml> <output.json> <output.yaml>")
		os.Exit(2)
	}
	input, err := os.ReadFile(os.Args[1])
	if err != nil {
		fail(err)
	}
	document, err := decodeDocument(input, filepath.Ext(os.Args[1]))
	if err != nil {
		fail(err)
	}
	if err := normalize(document); err != nil {
		fail(err)
	}
	jsonOutput, err := json.MarshalIndent(document, "", "  ")
	if err != nil {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…