Skip to content
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

OpenApiResponse with associations not working properly #443

Closed
cnizzardini opened this issue Jul 22, 2022 · 1 comment
Closed

OpenApiResponse with associations not working properly #443

cnizzardini opened this issue Jul 22, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@cnizzardini
Copy link
Owner

cnizzardini commented Jul 22, 2022

When specifying a hasOne in the associations whiteList the parent table disappears from the sample schema on schemaType is "array".

@cnizzardini cnizzardini added the bug Something isn't working label Jul 22, 2022
@cnizzardini
Copy link
Owner Author

cnizzardini commented Jul 22, 2022

Collections in https://github.com/cnizzardini/cakephp-swagger-bake/tree/master/src/Lib/MediaType need to move oneOf, anyOf, allOf, and not into the items array. It's currently getting overwritten in some cases. For example Generic needs to be:

        if ($schema instanceof Schema) {
            $items = [
                'type' => 'object',
                'properties' => $schema->getProperties(),
            ];
            if ($schema->getAllOf()) {
                $items['allOf'] = $schema->getAllOf();
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant