This PR complements #557 by adding the support of IgnoredMetadata to OpenAPI metadata resources like DefinedEntity.
The implementation tries to avoid duplicating the already existing mechanism used by XML ignored metadata, by creating an intermediate struct that normalises both XML and OpenAPI flavors into a common type that can be understood by the same filtering function.
For that reason we have
normaliseXmlMetadata: Transforms XML type into a normalised struct
normaliseOpenApiMetadata: Transforms OpenAPI into a normalised struct
With the two normalised structs, we can use filterSingleGenericMetadataEntry that now it doesn't care about OpenAPI nor XML, it just contains the logic to filter.
Then we have two filterSingleXmlMetadataEntry and filterSingleOpenApiMetadataEntry that calls the normalising function and the filtering.
This PR complements #557 by adding the support of
IgnoredMetadata
to OpenAPI metadata resources likeDefinedEntity
.The implementation tries to avoid duplicating the already existing mechanism used by XML ignored metadata, by creating an intermediate struct that normalises both XML and OpenAPI flavors into a common type that can be understood by the same filtering function.
For that reason we have
normaliseXmlMetadata
: Transforms XML type into a normalised structnormaliseOpenApiMetadata
: Transforms OpenAPI into a normalised structWith the two normalised structs, we can use
filterSingleGenericMetadataEntry
that now it doesn't care about OpenAPI nor XML, it just contains the logic to filter.Then we have two
filterSingleXmlMetadataEntry
andfilterSingleOpenApiMetadataEntry
that calls the normalising function and the filtering.