-
Notifications
You must be signed in to change notification settings - Fork 937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref by class name ? #1311
Comments
It's something that is not consistent yet, but using type instead of ref might work |
thanks |
With my use case, it seems to work with requestBody, but not with responses. I saw you're refactoring it in #1310, great ! new OA\Response(
response: 409,
description: 'Invalid parameter',
content: new OA\MediaType(
mediaType: 'application/json',
schema: new OA\Schema(type: \MyNamespace\Class::class)
)) will show "409": {
"description": "Invalid parameter",
"content": {
"application/json": {
"schema": {
"type": "MyNamespace\\Class"
}
}
}
}, |
@momala454 Make sure that |
it doesn't have #[\OA\Schema] but it have an extended Attribute : #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
class ApiExceptionAttribute extends \OpenApi\Attributes\Schema
{}
#[ApiExceptionAttribute]
class Class{} It doesn't work when I do it like this. Using "type" works only if I use directly |
@momala454 I have the same issue yesterday) Look at here:
Processor that expand classes for schemas do this just for At the moment I think that the best way to fix it would be add $exclude (array) parameter for |
Changing the |
@momala454 You are rigth. Problem was in another processor. See #1315 You can use it untill it woud be merged with fixes in
|
edit: nevermind my message before edit, I was modifying from the latest release, which doesn't use "OA\Schema" yet. |
The original issue was fixed in #1418 Any other issues should be raised in new, separate tickets. |
Is it possible to reference a schema using the class name instead of the schema name ?
the following doesn't work obviously as it doesn't return something in the form of "#/components/schemas/foo" when doing Foo::class
The text was updated successfully, but these errors were encountered: