ASF-ui icon indicating copy to clipboard operation
ASF-ui copied to clipboard

Only show valid config properties as options

Open Botan626 opened this issue 3 years ago • 9 comments

What UI shows: image

This setting on ASF wiki: https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Configuration#completetypestosend

Botan626 avatar Jun 23 '21 12:06 Botan626

Related: https://discord.com/channels/267292556709068800/332735075315744768/855995278385348629

Not sure if this issue is out of scope. I really do not want to parse wiki in order find out what are valid values for each property and I cant come up with a better approach right now.

I wonder what @Aareksio would do in such a situation.

MrBurrBurr avatar Jun 23 '21 13:06 MrBurrBurr

Maybe @JustArchi or @Abrynos have a suggestion on how to handle this situation?

MrBurrBurr avatar Jun 30 '21 15:06 MrBurrBurr

You don't, if swagger doesn't provide a way to further validate something, you shouldn't do anything extra.

Either you classify it as super important and we come to conclusion that we need to enhance our swagger schema to allow you to achieve that (as we did with flags enum), or it's irrelevant. In this case I believe it's irrelevant, ASF accepts all the options for that property, just because other do not make sense doesn't mean user can't select them.

JustArchi avatar Jun 30 '21 15:06 JustArchi

ASF accepts all the options for that property, just because other do not make sense doesn't mean user can't select them.

I get a 400 in response with this message: "Configured CompleteTypesToSend property is invalid: Sticker".

MrBurrBurr avatar Jun 30 '21 16:06 MrBurrBurr

I get a 400 in response with this message: "Configured CompleteTypesToSend property is invalid: Sticker".

Show the message to the user and do nothing else. You're writing frontend, not backend.

JustArchi avatar Jun 30 '21 16:06 JustArchi

Show the message to the user and do nothing else. You're writing frontend, not backend.

Yeah thats what we are doing currently.

MrBurrBurr avatar Jun 30 '21 16:06 MrBurrBurr

Apparently swagger supports min and max for various properties: https://swagger.io/docs/specification/data-models/data-types/

I might be able to make use of it to better define what values are valid for each prop, I'll mention you in appropriate commit if I do that @MrBurrBurr

JustArchi avatar Jun 30 '21 16:06 JustArchi

@MrBurrBurr https://github.com/JustArchiNET/ArchiSteamFarm/commit/874eb4d3a6db4b102b8b2a6bab9b5fcf57b2e385

JustArchi avatar Jun 30 '21 18:06 JustArchi

https://ptb.discord.com/channels/267292556709068800/332735075315744768/859854787634004049

JustArchi avatar Jul 04 '21 13:07 JustArchi