Page 1 of 1

[Therenas][1.1.61] LuaInventory.set_filter() API Doc param error

Posted: Sat Jul 09, 2022 10:49 pm
by Muppet9010
In the API Docs the function LuaInventory.set_filter has the param filter of type string. However I believe it should be string? based on its description for setting a nil value to clear the filter.

Page: https://lua-api.factorio.com/latest/Lua ... set_filter

Param highlighted by Chrome: https://lua-api.factorio.com/latest/Lua ... e%20filter

Re: [Therenas][1.1.61] LuaInventory.set_filter() API Doc param error

Posted: Tue Jul 12, 2022 10:02 pm
by Therenas
So this is a bit of a weird case, as the second parameter is not actually optional. It always needs to be there, but it can be 'nil'. This kind of API design pattern isn't used a lot in the API, but in some places it is. I updated the docs to show the type as 'string or nil' for the next release, which is the accurate way to describe this.

For posterity, these kinds of issues with the API can also be posted to the dedicated doc requests thread, where I'm more likely to see them. Thanks!