diff --git a/src/OpenApiType.php b/src/OpenApiType.php index 492848e..67585e5 100644 --- a/src/OpenApiType.php +++ b/src/OpenApiType.php @@ -130,6 +130,9 @@ public static function resolve(string $context, array $definitions, ParamTagValu } return new OpenApiType(type: "array", items: self::resolve($context, $definitions, $node->genericTypes[0])); } + if ($node instanceof GenericTypeNode && $node->type->name === 'value-of') { + Logger::panic($context, "'value-of' is not supported"); + } if ($node instanceof ArrayShapeNode) { $properties = []; @@ -266,7 +269,11 @@ enum: [(int)$node->constExpr->value], ); } - Logger::panic($context, "Unable to resolve OpenAPI type for type '" . get_class($node) . "'"); + if ($node instanceof ConstTypeNode) { + Logger::panic($context, 'Constants are not supported'); + } + + Logger::panic($context, "Unable to resolve OpenAPI type:\n" . var_export($node, true) . "\nPlease open an issue at https://github.com/nextcloud/openapi-extractor/issues/new with the error message and a link to your source code."); } /**