| 51 | const jsonSchemaVersion = "1" |
| 52 | |
| 53 | func newJSONErrorResponse(cmd *cobra.Command, err error) jsonErrorResponse { |
| 54 | return jsonErrorResponse{ |
| 55 | OK: false, |
| 56 | SchemaVersion: jsonSchemaVersion, |
| 57 | Command: jsonCommandPath(cmd), |
| 58 | Error: jsonError{ |
| 59 | Message: err.Error(), |
| 60 | Code: jsonErrorCode(err), |
| 61 | Details: jsonErrorDetailsForCommand(cmd, err), |
| 62 | }, |
| 63 | Warnings: jsonCommandWarnings(cmd), |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func newJSONOperationOutput(input any, results []jsonOperationResult, warnings []jsonWarning) jsonOperationOutput { |
| 68 | return jsonOperationOutput{ |