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

Add the feature to ignore metadata for OpenAPI metadata endpoints #632

Merged
merged 24 commits into from
Dec 4, 2023

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Nov 23, 2023

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.

abarreiro added 8 commits November 20, 2023 11:42
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
abarreiro added 14 commits November 23, 2023 12:27
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Fix
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro marked this pull request as ready for review November 28, 2023 09:11
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am generally good. I've got one comment. RDE test passed for me.

govcd/metadata_v2.go Outdated Show resolved Hide resolved
Signed-off-by: abarreiro <abarreiro@vmware.com>
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro self-assigned this Nov 30, 2023
@Didainius Didainius merged commit d3f64e4 into vmware:main Dec 4, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants