From ce5f19020e598840bc8899e730cd174d09a7d23d Mon Sep 17 00:00:00 2001 From: derfenix Date: Tue, 28 Mar 2023 22:37:05 +0300 Subject: [PATCH] Fix file format name in API --- api/openapi.yaml | 2 +- api/openapi/oas_json_gen.go | 4 ++-- api/openapi/oas_schemas_gen.go | 8 ++++---- api/openapi/oas_validators_gen.go | 2 +- ports/rest/converter.go | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 00b7293..2ccac4a 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -135,7 +135,7 @@ components: enum: - all - pdf - - single_page + - single_file - headers error: type: object diff --git a/api/openapi/oas_json_gen.go b/api/openapi/oas_json_gen.go index 8406603..4e63dbf 100644 --- a/api/openapi/oas_json_gen.go +++ b/api/openapi/oas_json_gen.go @@ -289,8 +289,8 @@ func (s *Format) Decode(d *jx.Decoder) error { *s = FormatAll case FormatPdf: *s = FormatPdf - case FormatSinglePage: - *s = FormatSinglePage + case FormatSingleFile: + *s = FormatSingleFile case FormatHeaders: *s = FormatHeaders default: diff --git a/api/openapi/oas_schemas_gen.go b/api/openapi/oas_schemas_gen.go index 886462b..b581f94 100644 --- a/api/openapi/oas_schemas_gen.go +++ b/api/openapi/oas_schemas_gen.go @@ -109,7 +109,7 @@ type Format string const ( FormatAll Format = "all" FormatPdf Format = "pdf" - FormatSinglePage Format = "single_page" + FormatSingleFile Format = "single_file" FormatHeaders Format = "headers" ) @@ -120,7 +120,7 @@ func (s Format) MarshalText() ([]byte, error) { return []byte(s), nil case FormatPdf: return []byte(s), nil - case FormatSinglePage: + case FormatSingleFile: return []byte(s), nil case FormatHeaders: return []byte(s), nil @@ -138,8 +138,8 @@ func (s *Format) UnmarshalText(data []byte) error { case FormatPdf: *s = FormatPdf return nil - case FormatSinglePage: - *s = FormatSinglePage + case FormatSingleFile: + *s = FormatSingleFile return nil case FormatHeaders: *s = FormatHeaders diff --git a/api/openapi/oas_validators_gen.go b/api/openapi/oas_validators_gen.go index bbc15c1..a8c3490 100644 --- a/api/openapi/oas_validators_gen.go +++ b/api/openapi/oas_validators_gen.go @@ -48,7 +48,7 @@ func (s Format) Validate() error { return nil case "pdf": return nil - case "single_page": + case "single_file": return nil case "headers": return nil diff --git a/ports/rest/converter.go b/ports/rest/converter.go index 2d9d367..8459092 100644 --- a/ports/rest/converter.go +++ b/ports/rest/converter.go @@ -110,7 +110,7 @@ func FormatFromRest(format []openapi.Format) []entity.Format { case openapi.FormatHeaders: formats[i] = entity.FormatHeaders - case openapi.FormatSinglePage: + case openapi.FormatSingleFile: formats[i] = entity.FormatSingleFile } } @@ -124,7 +124,7 @@ func FormatToRest(format entity.Format) openapi.Format { case entity.FormatPDF: return openapi.FormatPdf case entity.FormatSingleFile: - return openapi.FormatSinglePage + return openapi.FormatSingleFile case entity.FormatHeaders: return openapi.FormatHeaders default: