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
Describe the bug
When retrieving the type name via the ApodiniTypeInformation framework of a type which is e.g. declared in a function, the OpenAPI doesn't support those as the type name includes characters which are disallowed in OpenAPI schema references.
To Reproduce
Given the example of (assuming this lies in a target name ExampleTarget):
it will print the string ExampleTarget.OuterTest.(unknown context at $109f9c144).(unknown context at $109f9c14c).Test.
ApodiniTypeInformation will create a TypeName which the type Test, target name ExampleTarget and the nested type (unknowncontextat$109f9c144) and (unknowncontextat$109f9c14c).
OpenAPI will just use the concatenation of those when creating a schema entry. This is problematic when trying to reference it, as the type name contains the illegal character (, ) and $.
Expected behavior
It is not entirely clear what the best solution is. One might simple replace those illegal characters, but then we still have an unstable type name (the hex digits change for every compilation step). If we just remove those unknown context entries, it might result in a name collision with a type with the same name defined on the level without those "context" levels or with a type name placed in another function.
The text was updated successfully, but these errors were encountered:
This is not an issue at all for OpenAPI schemas. A type defined inside of a function, is accessible only inside the scope of that function, hence there is no way to use Test as a return type of a Handler, or as a property of a Content type
Ah yes, you are right. Maybe it would make sense to move this issue to the TypeInformation framework so those „unknown context“ cases are represented properly in the TypeName structure?
Describe the bug
When retrieving the type name via the
ApodiniTypeInformation
framework of a type which is e.g. declared in a function, the OpenAPI doesn't support those as the type name includes characters which are disallowed in OpenAPI schema references.To Reproduce
Given the example of (assuming this lies in a target name
ExampleTarget
):it will print the string
ExampleTarget.OuterTest.(unknown context at $109f9c144).(unknown context at $109f9c14c).Test
.ApodiniTypeInformation
will create aTypeName
which the typeTest
, target nameExampleTarget
and the nested type(unknowncontextat$109f9c144)
and(unknowncontextat$109f9c14c)
.OpenAPI will just use the concatenation of those when creating a schema entry. This is problematic when trying to reference it, as the type name contains the illegal character
(
,)
and$
.Expected behavior
It is not entirely clear what the best solution is. One might simple replace those illegal characters, but then we still have an unstable type name (the hex digits change for every compilation step). If we just remove those unknown context entries, it might result in a name collision with a type with the same name defined on the level without those
"context"
levels or with a type name placed in another function.The text was updated successfully, but these errors were encountered: