mirror of
https://github.com/derfenix/webarchive.git
synced 2026-03-11 22:40:58 +03:00
Fix file format name in API
This commit is contained in:
@@ -135,7 +135,7 @@ components:
|
|||||||
enum:
|
enum:
|
||||||
- all
|
- all
|
||||||
- pdf
|
- pdf
|
||||||
- single_page
|
- single_file
|
||||||
- headers
|
- headers
|
||||||
error:
|
error:
|
||||||
type: object
|
type: object
|
||||||
|
|||||||
@@ -289,8 +289,8 @@ func (s *Format) Decode(d *jx.Decoder) error {
|
|||||||
*s = FormatAll
|
*s = FormatAll
|
||||||
case FormatPdf:
|
case FormatPdf:
|
||||||
*s = FormatPdf
|
*s = FormatPdf
|
||||||
case FormatSinglePage:
|
case FormatSingleFile:
|
||||||
*s = FormatSinglePage
|
*s = FormatSingleFile
|
||||||
case FormatHeaders:
|
case FormatHeaders:
|
||||||
*s = FormatHeaders
|
*s = FormatHeaders
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ type Format string
|
|||||||
const (
|
const (
|
||||||
FormatAll Format = "all"
|
FormatAll Format = "all"
|
||||||
FormatPdf Format = "pdf"
|
FormatPdf Format = "pdf"
|
||||||
FormatSinglePage Format = "single_page"
|
FormatSingleFile Format = "single_file"
|
||||||
FormatHeaders Format = "headers"
|
FormatHeaders Format = "headers"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ func (s Format) MarshalText() ([]byte, error) {
|
|||||||
return []byte(s), nil
|
return []byte(s), nil
|
||||||
case FormatPdf:
|
case FormatPdf:
|
||||||
return []byte(s), nil
|
return []byte(s), nil
|
||||||
case FormatSinglePage:
|
case FormatSingleFile:
|
||||||
return []byte(s), nil
|
return []byte(s), nil
|
||||||
case FormatHeaders:
|
case FormatHeaders:
|
||||||
return []byte(s), nil
|
return []byte(s), nil
|
||||||
@@ -138,8 +138,8 @@ func (s *Format) UnmarshalText(data []byte) error {
|
|||||||
case FormatPdf:
|
case FormatPdf:
|
||||||
*s = FormatPdf
|
*s = FormatPdf
|
||||||
return nil
|
return nil
|
||||||
case FormatSinglePage:
|
case FormatSingleFile:
|
||||||
*s = FormatSinglePage
|
*s = FormatSingleFile
|
||||||
return nil
|
return nil
|
||||||
case FormatHeaders:
|
case FormatHeaders:
|
||||||
*s = FormatHeaders
|
*s = FormatHeaders
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ func (s Format) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
case "pdf":
|
case "pdf":
|
||||||
return nil
|
return nil
|
||||||
case "single_page":
|
case "single_file":
|
||||||
return nil
|
return nil
|
||||||
case "headers":
|
case "headers":
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ func FormatFromRest(format []openapi.Format) []entity.Format {
|
|||||||
case openapi.FormatHeaders:
|
case openapi.FormatHeaders:
|
||||||
formats[i] = entity.FormatHeaders
|
formats[i] = entity.FormatHeaders
|
||||||
|
|
||||||
case openapi.FormatSinglePage:
|
case openapi.FormatSingleFile:
|
||||||
formats[i] = entity.FormatSingleFile
|
formats[i] = entity.FormatSingleFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ func FormatToRest(format entity.Format) openapi.Format {
|
|||||||
case entity.FormatPDF:
|
case entity.FormatPDF:
|
||||||
return openapi.FormatPdf
|
return openapi.FormatPdf
|
||||||
case entity.FormatSingleFile:
|
case entity.FormatSingleFile:
|
||||||
return openapi.FormatSinglePage
|
return openapi.FormatSingleFile
|
||||||
case entity.FormatHeaders:
|
case entity.FormatHeaders:
|
||||||
return openapi.FormatHeaders
|
return openapi.FormatHeaders
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user