{"id":18086949,"url":"https://github.com/denismakogon/fn-openapi-v3","last_synced_at":"2025-07-19T17:11:47.791Z","repository":{"id":152748693,"uuid":"117738868","full_name":"denismakogon/fn-openapi-v3","owner":"denismakogon","description":"Fn-powered serverless application OpenAPI v3.0.0 generator tool","archived":false,"fork":false,"pushed_at":"2018-01-17T18:35:11.000Z","size":17,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T07:45:36.352Z","etag":null,"topics":["fnproject","go","golang","openapi3","serverless","swagger"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denismakogon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-16T20:38:36.000Z","updated_at":"2019-06-11T20:40:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bc308fc-5634-4855-9796-f90fcca44e6d","html_url":"https://github.com/denismakogon/fn-openapi-v3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Ffn-openapi-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Ffn-openapi-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Ffn-openapi-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Ffn-openapi-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denismakogon","download_url":"https://codeload.github.com/denismakogon/fn-openapi-v3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423460,"owners_count":20936620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fnproject","go","golang","openapi3","serverless","swagger"],"created_at":"2024-10-31T16:59:31.119Z","updated_at":"2025-04-06T01:28:35.400Z","avatar_url":"https://github.com/denismakogon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"OpenAPI v3 spec generator tool for Fn applications\n==================================================\n\nIdea\n----\nThe Fn application is nothing but set of function where each has its own HTTP route for execution.\n\nWhat if there's a way to build client binding for the particular serverless application?\n\nThis library and tool are designed to provide necessary API to generate OpenAPI v3.0.0 specification using Function spec language.\n\n\nFunction spec language\n----------------------\n\nThis tool relies on improved Swagger API 2.0 plus additional inline referencing features \nthat are missing in both Swagger 2.0 and OpenAPI 3.0 that are allowing developers to structure their application in more modular way.\n\n\nFunction spec example\n---------------------\n\n```yaml\nversion: 0.0.1\ndescription: Functions spec that describes Fn-powered serverless application\nfunctions:\n  createUser:\n    handler: handler.create\n    events:\n      - http:\n          method: post\n          fn: ${file(models/func.yml):first}\n          documentation:\n            summary: Create User\n            description: Creates a user and then sends a generated password email\n            requestBody:\n              schema: ${file(models/request.json)}\n            parameters:\n              - name: username\n                description: The username for a user to create\n                required: true\n                in: path\n                schema:\n                  type: string\n                  pattern: \"^[-a-z0-9_]+$\"\n              - name: membershipType\n                description: The user's Membership Type\n                required: true\n                in: query\n                schema:\n                  type: string\n                  enum:\n                    - premium\n                    - standard\n            responses:\n              200:\n                description: create a user\n                content:\n                  application/json:\n                    schema: ${file(models/request.json)}\n              500:\n                description: error\n                content:\n                  application/json:\n                    schema: ${file(models/error.json)}\n```\nThis sample you can find [here](examples/fn.yml)\n\nusing the following code:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/denismakogon/fn-openapi/models\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\n\tyamlFile, err := ioutil.ReadFile(os.Args[1])\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\tos.Exit(1)\n\t}\n\n\tvar fn models.Fn\n\n\terr = fn.Unmarshal(yamlFile, os.Stdout)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\tos.Exit(1)\n\t}\n\n\tvar oai models.OpenAPISpec\n\terr = oai.FromFnSpec(\"http://localhost:8080\", \u0026fn)\n\terr = oai.Marshal(os.Stdout)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t\tos.Exit(1)\n\t}\n}\n```\n\nit is possible to turn Function spec into valid OpenAPI v3 specification.\nTo confirm that spec is valid use the following command:\n```bash\ndocker run --rm -i -v `pwd`:/go fnproject/openapiv3-validator:0.0.1 /go/examples/openapi.yml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismakogon%2Ffn-openapi-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenismakogon%2Ffn-openapi-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismakogon%2Ffn-openapi-v3/lists"}