Fix incorrect param-combination claims on phone number search#383
Merged
Conversation
The Search Available Phone Numbers endpoint documented combination restrictions on the region and city query params that the backend does not enforce. Confirmed against the Rails source: for local searches the only combination rules are that starts_with/contains/ends_with are mutually exclusive and that city requires region. Nothing restricts areacode, region, or city against each other. - region: remove the false 'Cannot be used in combination with areacode.' - city: remove the unsupported 'Cannot be used in combination with areacode, starts_with, contains, or ends_with.' sentence; keep the 'Must be used in combination with region.' rule the backend enforces Regenerated fern/apis/signalwire-rest/openapi.yaml from the spec.
Contributor
For number_type=toll-free, the backend's Search::Tollfree::{Inteliquent,
Belle} contracts reject region or city with a 422
('does not support those search filters'). Document that region and
city apply to local searches only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #382
Problem
The Relay REST Search Available Phone Numbers endpoint documented combination restrictions on the
regionandcityquery params that the backend does not enforce. Requests combiningareacode+region(andareacode+region+city) return200 OKwith results.Changes
specs/signalwire-rest/relay-rest/phone-numbers/main.tsp(@docdecorators), withfern/apis/signalwire-rest/openapi.yamlregenerated:region— removed the false "Cannot be used in combination with areacode."; added that it's supported for local searches only (not toll-free).city— removed the unsupported "Cannot be used in combination with areacode, starts_with, contains, or ends_with." sentence; kept "Must be used in combination with region." (the one rule the backend enforces); added that it's supported for local searches only (not toll-free).Verification
yarn build:specsregeneratesopenapi.yaml; diff limited to the two description lines.yarn fern-checkpasses (0 errors).