meilisearch / meilisearch-swift

Swift client for the Meilisearch API
https://www.meilisearch.com
MIT License
93 stars 26 forks source link

Unsupported URL when Schema Unspecified #421

Closed Sherlouk closed 1 year ago

Sherlouk commented 1 year ago

Strictly speaking, the package calls for the "host" which under spec doesn't include the schema. If I specify a URL without the schema, only when requesting a resource do you get an error:

meiliSearchCommunicationError(message: "unsupported URL", url: "<google.com>/indexes/stations/search")

URLs are validated when the client is initialised, so it's unclear why this gets so far through the stack before failing.

We should be more resilient to different kinds of URL inputs. We should also provide more documentation (in README and inline). We should do more thorough validation on client initialisation.

Sherlouk commented 1 year ago

It's possible this is a bug caused by iOS 17/Xcode 15 changes: https://forums.swift.org/t/url-string-behavior-changed-with-xcode-15-0-beta-5/66570/5

edit:// confirmed. We should take this as an opportunity to upgrade CI/CD to Xcode 15 (https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode).