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

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Muppet9010
Filter Inserter
Filter Inserter
Posts: 278
Joined: Sat Dec 09, 2017 6:01 pm
Contact:

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

Post 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

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

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

Post 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!

Post Reply

Return to “Resolved Problems and Bugs”