-
Notifications
You must be signed in to change notification settings - Fork 8
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
Query Case Insensitivity #118
Conversation
for more information, see https://pre-commit.ci
not sure how to handle the CI failure except for adding |
Yeah this is a typing error because the way those new classes evaluate the type checker can not understand. Which kinda kills the point of the type checker at all. I would rather try to find a solution that is typesafe if possible |
We can add validators that do the uppercasing and lowercasing to these models instead of messing with the literals |
oh that's an interesting solution, let me see what it looks like once i merge it in |
actually doesn't this approach make trying a request with |
Yeah currently. If its desired, a validator can be added to handle capitalizing GetMap. But i wouldnt worry about it because thats what the spec says it should be. Ohhhh i see what you are saying now. Yeah that can be fixed by validators |
no, your PR lowercases the keys, not the values. idk about lowercasing all of the string values anyhow, could that cause issues down the road? Edit: I was trying to figure out a way to add a custom validator to all |
I would just change it to be |
Or @model_validator(mode="before")
def validate_item(cls, values: Any) -> Any:
item = values.get("item")
if item.lower() == "layerdetails":
values["item"] = "layerDetails"
return values |
Well that is what I was trying to avoid, it would be easy enough to add a validator with a manual list of the |
I would rather be explicit about it since its not going to change often |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!!!
Literals
in query params case insensitivelayers
,layername
, andquery_layers
all aliases of each othersrs
andcrs
aliases of each otheradditional_coords
forselfe
andfvcom
grid typesGetLegendInfo.alias
to default toFalse
, as it gets set to true anyhow when the request doesn't have acolorscalerange