Generate OpenAPI 3 schemas from the swagger 2.0 generation (#1017)

* Generate OpenAPI 3 schemas from the swagger 2.0 generation

* Update API description URL in index.md
This commit is contained in:
Matt
2025-09-23 12:14:37 -04:00
committed by GitHub
parent b56505452f
commit 609b7a606b
11 changed files with 14896 additions and 4 deletions

View File

@@ -23,10 +23,13 @@ tasks:
INTERNAL: "../../../internal" INTERNAL: "../../../internal"
PKGS: "../../../pkgs" PKGS: "../../../pkgs"
cmds: cmds:
- swag fmt --dir={{ .API }}
- swag init --dir={{ .API }},{{ .INTERNAL }}/core/services,{{ .INTERNAL }}/data/repo --parseDependency - swag init --dir={{ .API }},{{ .INTERNAL }}/core/services,{{ .INTERNAL }}/data/repo --parseDependency
- cp -r ./docs/swagger.json ../../../../docs/en/api/openapi-2.0.json - npx -y -p swagger2openapi swagger2openapi --outfile ./docs/openapi-3.json ./docs/swagger.json
- cp -r ./docs/swagger.yaml ../../../../docs/en/api/openapi-2.0.yaml - npx -y -p swagger2openapi swagger2openapi --yaml --outfile ./docs/openapi-3.yaml ./docs/swagger.json
- cp -r ./docs/swagger.json ../../../../docs/en/api/swagger-2.0.json
- cp -r ./docs/swagger.yaml ../../../../docs/en/api/swagger-2.0.yaml
- cp -r ./docs/openapi-3.json ../../../../docs/en/api/openapi-3.0.json
- cp -r ./docs/openapi-3.yaml ../../../../docs/en/api/openapi-3.0.yaml
sources: sources:
- "./backend/app/api/**/*" - "./backend/app/api/**/*"
- "./backend/internal/data/**" - "./backend/internal/data/**"

View File

@@ -2240,6 +2240,9 @@ const docTemplate = `{
"code": { "code": {
"type": "string" "type": "string"
}, },
"decimals": {
"type": "integer"
},
"local": { "local": {
"type": "string" "type": "string"
}, },

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2238,6 +2238,9 @@
"code": { "code": {
"type": "string" "type": "string"
}, },
"decimals": {
"type": "integer"
},
"local": { "local": {
"type": "string" "type": "string"
}, },

View File

@@ -34,6 +34,8 @@ definitions:
properties: properties:
code: code:
type: string type: string
decimals:
type: integer
local: local:
type: string type: string
name: name:

View File

@@ -50,7 +50,7 @@ document.head.appendChild(elementStyle);
<client-only> <client-only>
<elements-api <elements-api
:key="componentKey" :key="componentKey"
apiDescriptionUrl="https://raw.githubusercontent.com/sysadminsmedia/homebox/refs/heads/main/docs/en/api/openapi-2.0.json" apiDescriptionUrl="https://raw.githubusercontent.com/sysadminsmedia/homebox/refs/heads/main/docs/en/api/openapi-3.0.json"
router="hash" router="hash"
layout="responsive" layout="responsive"
hideSchemas="true" hideSchemas="true"

4550
docs/en/api/openapi-3.0.json Normal file

File diff suppressed because it is too large Load Diff

2888
docs/en/api/openapi-3.0.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2238,6 +2238,9 @@
"code": { "code": {
"type": "string" "type": "string"
}, },
"decimals": {
"type": "integer"
},
"local": { "local": {
"type": "string" "type": "string"
}, },

View File

@@ -34,6 +34,8 @@ definitions:
properties: properties:
code: code:
type: string type: string
decimals:
type: integer
local: local:
type: string type: string
name: name: