From 678ecfd58999567ffe65fe56371d79aa52c108c8 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Thu, 17 Oct 2024 20:27:11 -0500 Subject: [PATCH] CE-1887 Add withRefToSchema; allow setType to set null --- .../java/com/kingsrook/qqq/openapi/model/Schema.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qqq-openapi/src/main/java/com/kingsrook/qqq/openapi/model/Schema.java b/qqq-openapi/src/main/java/com/kingsrook/qqq/openapi/model/Schema.java index 39707b83..ed08a513 100644 --- a/qqq-openapi/src/main/java/com/kingsrook/qqq/openapi/model/Schema.java +++ b/qqq-openapi/src/main/java/com/kingsrook/qqq/openapi/model/Schema.java @@ -92,7 +92,7 @@ public class Schema *******************************************************************************/ public void setType(Type type) { - this.type = type.toString().toLowerCase(); + this.type = type == null ? null : type.toString().toLowerCase(); } @@ -697,4 +697,14 @@ public class Schema return (this); } + + + /*************************************************************************** + ** + ***************************************************************************/ + public Schema withRefToSchema(String componentName) + { + return withRef("#/components/schemas/" + componentName); + } + }