diff --git a/backend/controller/console.go b/backend/controller/console.go index e19f9a0049..17d5147bce 100644 --- a/backend/controller/console.go +++ b/backend/controller/console.go @@ -99,16 +99,18 @@ func (c *ConsoleService) GetModules(ctx context.Context, req *connect.Request[pb v := decl.ToProto().(*schemapb.Verb) verbSchema := schema.VerbFromProto(v) var jsonRequestSchema string - if requestData, ok := verbSchema.Request.(*schema.Ref); ok { - jsonSchema, err := schema.DataToJSONSchema(sch, *requestData) - if err != nil { - return nil, err + if verbSchema.Request == nil { + if requestData, ok := verbSchema.Request.(*schema.Ref); ok { + jsonSchema, err := schema.DataToJSONSchema(sch, *requestData) + if err != nil { + return nil, err + } + jsonData, err := json.MarshalIndent(jsonSchema, "", " ") + if err != nil { + return nil, err + } + jsonRequestSchema = string(jsonData) } - jsonData, err := json.MarshalIndent(jsonSchema, "", " ") - if err != nil { - return nil, err - } - jsonRequestSchema = string(jsonData) } schemaString, err := verbSchemaString(sch, decl) diff --git a/frontend/src/features/verbs/verb.utils.ts b/frontend/src/features/verbs/verb.utils.ts index 412a52a39d..aa0b725c31 100644 --- a/frontend/src/features/verbs/verb.utils.ts +++ b/frontend/src/features/verbs/verb.utils.ts @@ -32,6 +32,10 @@ const processJsonValue = (value: JsonValue): JsonValue =>{ // eslint-disable-next-line @typescript-eslint/no-explicit-any export const simpleJsonSchema = (verb: Verb): any => { + if (!verb.jsonRequestSchema) { + return {} + } + let schema = JSON.parse(verb.jsonRequestSchema) if (schema.properties && isHttpIngress(verb)) {