From 605597aaf4e9d65576c7631c9d8b877a9901f84e Mon Sep 17 00:00:00 2001 From: EwenQuim Date: Mon, 22 Jul 2024 12:58:40 +0200 Subject: [PATCH] Updated the golden file with the new OpenAPI description --- examples/petstore/testdata/doc/openapi.golden.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/petstore/testdata/doc/openapi.golden.json b/examples/petstore/testdata/doc/openapi.golden.json index a2d6ce1c..eda86df2 100644 --- a/examples/petstore/testdata/doc/openapi.golden.json +++ b/examples/petstore/testdata/doc/openapi.golden.json @@ -81,7 +81,7 @@ } }, "info": { - "description": "OpenAPI", + "description": "\nThis is the autogenerated OpenAPI documentation for your [Fuego](https://github.com/go-fuego/fuego) API.\n\nBelow is a Fuego Cheatsheet to help you get started. Don't hesitate to check the [Fuego documentation](https://go-fuego.github.io/fuego) for more details.\n\nHappy coding! 🔥\n\n## Usage\n\n### Route registration\n\n```go\nfunc main() {\n\t// Create a new server\n\ts := fuego.NewServer()\n\n\t// Register some routes\n\tfuego.Post(s, \"/hello\", myController)\n\tfuego.Get(s, \"/myPath\", otherController)\n\tfuego.Put(s, \"/hello\", thirdController)\n\n\tadminRoutes := fuego.Group(s, \"/admin\")\n\tfuego.Use(adminRoutes, myMiddleware) // This middleware (for authentication, etc...) will be available for routes starting by /admin/*, \n\tfuego.Get(adminRoutes, \"/hello\", groupController) // This route will be available at /admin/hello\n\n\t// Start the server\n\ts.Start()\n}\n```\n\n### Basic controller\n\n```go\ntype MyBody struct {\n\tName string `json:\"name\" validate:\"required,max=30\"`\n}\n\ntype MyResponse struct {\n\tAnswer string `json:\"answer\"`\n}\n\nfunc hello(ctx *fuego.ContextWithBody[MyBody]) (*MyResponse, error) {\n\tbody, err := ctx.Body()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn \u0026MyResponse{Answer: \"Hello \" + body.Name}, nil\n}\n```\n\n### Add more details to the route\n\n```go\nfuego.Get(s, \"/hello\", myController).\n\tDescription(\"This is a route that says hello\").\n\tSummary(\"Say hello\").\n```\n", "title": "OpenAPI", "version": "0.0.1" },