-
-
Notifications
You must be signed in to change notification settings - Fork 957
Open
Description
API Platform version(s) affected: 4.2.2
Description
#7419 introduces a regression for our project using @rtk-query/codegen-openapi as defining 'hydra:member': object[] instead of 'hydra:member': any makes Typescript consider type is object[] even if hydra:member is redefined as a correct type like FooBarJsonldBazCollection[] like this:
export type FooBarJsonldBazCollectionApiResponse =
/** status 200 FooBarBaz */ HydraCollectionBaseSchema & {
'hydra:member'?: FooBarJsonldBazCollection[]
}How to reproduce
- Open http://localhost:8000/api/docs.jsonopenapi (with a running API platform (core) project)
- if API is 4.2.1,
HydraCollectionBaseSchemausesanyformember - if API is 4.2.2,
HydraCollectionBaseSchemausesobject[]formember
Possible Solution
make this object[] change optional / configurable
Additional Context
For now, our workaround is to replace all occurences in each of our generated API files:
for api in src/redux/*Api.ts ; do
echo "api='$api'"
sed -i "s/'hydra:member': object\[\]/'hydra:member': any/g" $api
doneguiguichupote
Metadata
Metadata
Assignees
Labels
No labels