You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 20, 2024. It is now read-only.
foreach ($apiDef->getTypes() as $type) {
var_dump($type->getItems());
}
should print dump of StringType object
Actual Behavior
Throws exception:
Exception: No type found for name array
because
/**
* Retrieves a type by name
*
* @param string $name Name of the Type to retrieve.
*
* @return \Raml\TypeInterface Returns Type matching given name if found.
* @throws \Exception When no type is found.
**/
public function getTypeByName($name)
{
foreach ($this->collection as $type) {
/** @var $type \Raml\TypeInterface */
if ($type->getName() === $name) {
return $type;
}
}
throw new \Exception(sprintf('No type found for name %s, list: %s', var_export($name, true), var_export($this->collection, true)));
}
it tries to find the array type inside the list of already declared complex types instead of create new scalar StringType