meilisearch-swift icon indicating copy to clipboard operation
meilisearch-swift copied to clipboard

Change naming of API path variable from `query` to `path`

Open bidoubiwa opened this issue 3 years ago • 4 comments
trafficstars

In this example, we use let query to define the API path. As per this comment: https://github.com/meilisearch/meilisearch-swift/pull/248#discussion_r802883984

We should change the wording from query to path everywhere query is used to define a path to an API route.

Example: https://github.com/meilisearch/meilisearch-swift/blob/f322911570ae4d7836fd6f1bce49d1dec6ba12b2/Sources/MeiliSearch/Documents.swift#L21

Should become let path

bidoubiwa avatar Feb 10 '22 13:02 bidoubiwa

Hi there, I'm new to open source but I'd like to tackle this one if possible. Is it just changing the constant name to let path from let query where it is called in the Documents Swift file in the Model for Meilisearch? Or does it need to be changed elsewhere? I could do this asap and is it possible to submit the documents file only in a pull request if the change is only there for the file path for the API? Thanks for your time!

AE542 avatar Feb 11 '22 17:02 AE542

I would like to work on this. I have experience working in Swift and iOS development. It would be great if anyone from the team can assign this issue to me.

Dishant10 avatar Oct 16 '22 11:10 Dishant10

Thanks for your interest in this project :fire: You are more than welcome to open a PR for this!

We prefer not assigning people to our issues because sometimes people ask to be assigned and never return, discouraging genuine volunteer contributors from opening a PR to fix this issue. We will accept and merge the first PR that correctly fixes and implements the issue following our contributing guidelines.

We are looking forward to reviewing your PR :blush:

brunoocasali avatar Oct 17 '22 18:10 brunoocasali

Sure! Thank you! I'll take a look at all the things required and will definitely try to fix this issue as soon as possible.

Dishant10 avatar Oct 19 '22 09:10 Dishant10

Hey @brunoocasali , I was working on this issue. I've also changed the query to path in the documents file. I wanted to know apart from documents file is there any where else where I have to change the given ? I've looked a few files and couldn't find 'query' as an API name. Do I have to check every file in each folder structure or is there a better way ? I'll do that if there isn't. Would really appreciate your response to this question of mine. I'll do accordingly and will follow your suggestion. Thank you!

Dishant10 avatar Oct 24 '22 12:10 Dishant10

Hi @Dishant10.

The documents file was just an example, so if you find any other usage of query that is actually a full path, you can switch! :)

brunoocasali avatar Oct 24 '22 14:10 brunoocasali

Okay got it! So do I have to check every file to see whether query was set to a path or not? Also there's a function toQuery I'll check that too.

Dishant10 avatar Oct 24 '22 19:10 Dishant10

For this issue, you can only rename the variables, and that's it!

If you want to do more, you can send a new PR :)

brunoocasali avatar Oct 24 '22 19:10 brunoocasali

Okay got your point! So I've checked and did not find any variable named query where query was set to be a full path except documents file and I've changed query to path where query was defined to be a full path. Does this sound good ? Thank you!

Dishant10 avatar Oct 24 '22 20:10 Dishant10

Yes it is awesome, please send your PR :D

brunoocasali avatar Oct 24 '22 20:10 brunoocasali

I've raised a PR please review it and leave comments if you want anything else to be added or removed also if I need to do it in another way. I'll be happy to incorporate your suggestions. Thank you!

Dishant10 avatar Oct 26 '22 10:10 Dishant10