mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
fix: blank version issue
This commit is contained in:
@@ -144,17 +144,23 @@ func (r FileNodeType) IsKnown() bool {
|
||||
}
|
||||
|
||||
type FileReadResponse struct {
|
||||
Content string `json:"content,required"`
|
||||
Diff string `json:"diff"`
|
||||
Patch FileReadResponsePatch `json:"patch"`
|
||||
JSON fileReadResponseJSON `json:"-"`
|
||||
Content string `json:"content,required"`
|
||||
Type FileReadResponseType `json:"type,required"`
|
||||
Diff string `json:"diff"`
|
||||
Encoding FileReadResponseEncoding `json:"encoding"`
|
||||
MimeType string `json:"mimeType"`
|
||||
Patch FileReadResponsePatch `json:"patch"`
|
||||
JSON fileReadResponseJSON `json:"-"`
|
||||
}
|
||||
|
||||
// fileReadResponseJSON contains the JSON metadata for the struct
|
||||
// [FileReadResponse]
|
||||
type fileReadResponseJSON struct {
|
||||
Content apijson.Field
|
||||
Type apijson.Field
|
||||
Diff apijson.Field
|
||||
Encoding apijson.Field
|
||||
MimeType apijson.Field
|
||||
Patch apijson.Field
|
||||
raw string
|
||||
ExtraFields map[string]apijson.Field
|
||||
@@ -168,6 +174,34 @@ func (r fileReadResponseJSON) RawJSON() string {
|
||||
return r.raw
|
||||
}
|
||||
|
||||
type FileReadResponseType string
|
||||
|
||||
const (
|
||||
FileReadResponseTypeText FileReadResponseType = "text"
|
||||
)
|
||||
|
||||
func (r FileReadResponseType) IsKnown() bool {
|
||||
switch r {
|
||||
case FileReadResponseTypeText:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type FileReadResponseEncoding string
|
||||
|
||||
const (
|
||||
FileReadResponseEncodingBase64 FileReadResponseEncoding = "base64"
|
||||
)
|
||||
|
||||
func (r FileReadResponseEncoding) IsKnown() bool {
|
||||
switch r {
|
||||
case FileReadResponseEncodingBase64:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type FileReadResponsePatch struct {
|
||||
Hunks []FileReadResponsePatchHunk `json:"hunks,required"`
|
||||
NewFileName string `json:"newFileName,required"`
|
||||
|
||||
Reference in New Issue
Block a user