Skip to content

Commit f1322a0

Browse files
authored
Better null check in normalizeSchema (#22671)
* uncomment exit * better null check when normalizing schema
1 parent 23dae2b commit f1322a0

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

bin/generate-samples.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,5 @@ fi
6868

6969
if [[ -n "$GENERATE_ERROR" ]]; then
7070
echo "Found exception(s) when running the generator(s) to update the samples."
71-
# UNCOMMENT LATER
72-
#exit 1
71+
exit 1
7372
fi

modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ protected boolean isSelfReference(String name, Schema subSchema) {
696696
*/
697697
public Schema normalizeSchema(Schema schema, Set<Schema> visitedSchemas) {
698698
// normalize reference schema
699-
if (StringUtils.isNotEmpty(schema.get$ref())) {
699+
if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) {
700700
normalizeReferenceSchema(schema);
701701
}
702702

0 commit comments

Comments
 (0)