tdabasinskas / go-backstage

Go client library for accessing the Backstage REST API
https://pkg.go.dev/github.com/tdabasinskas/go-backstage/backstage
Apache License 2.0
25 stars 4 forks source link

Question about Filtering #6

Closed craigcooper11 closed 1 year ago

craigcooper11 commented 1 year ago

Hello @tdabasinskas! I was wondering if there is a way to filter by an OR statement? Right now, it looks like the sdk only supports the AND. https://backstage.io/docs/features/software-catalog/software-catalog-api/#filtering For example, if I wanted to filter by namespace OR kind I would expect the query string to look like metadata.namespace=default&filter=kind=group. But, the SDK is creating this query param metadata.namespace=default,kind=group Do you know if this is possible today or would there need to be a code change?

tdabasinskas commented 1 year ago

Hi @craigcooper11 ,

Sorry for delay looking into this.

You're right, the current implementation was limited, and it didn't support OR conditions. I've made some refactoring under #7 to address this.

Could you try using go get github.com/tdabasinskas/go-backstage/v2@filters and let me know if it works as expected now?

craigcooper11 commented 1 year ago

@tdabasinskas Looks great! Thank you so much for the update.

tdabasinskas commented 1 year ago

Thanks for confirming it. Let me merge this and release v2.0.0.