Fix file format name in API

This commit is contained in:
2023-03-28 22:37:05 +03:00
parent 9262249ea1
commit ce5f19020e
5 changed files with 10 additions and 10 deletions

View File

@@ -135,7 +135,7 @@ components:
enum:
- all
- pdf
- single_page
- single_file
- headers
error:
type: object

View File

@@ -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:

View File

@@ -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

View File

@@ -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