Skip to content

Update to handle the new RouterOS v7.18 api syntax with empty responses#105

Merged
danikf merged 1 commit into
danikf:masterfrom
xPucTu4:routeros-7.18-empty-response
Jan 4, 2026
Merged

Update to handle the new RouterOS v7.18 api syntax with empty responses#105
danikf merged 1 commit into
danikf:masterfrom
xPucTu4:routeros-7.18-empty-response

Conversation

@xPucTu4
Copy link
Copy Markdown
Contributor

@xPucTu4 xPucTu4 commented Feb 18, 2025

  • Added handling for ApiEmptySentence in ApiCommand.cs to return an empty list when the first response is empty.
  • Introduced !empty case in ApiConnection.cs to process empty responses.
  • Created ApiEmptySentence class to manage empty response types, enhancing API functionality.

Closes #103
This is a duplicate of PR #104 , recreated due to unintended additional changes in the original PR.

- Added handling for `ApiEmptySentence` in `ApiCommand.cs` to return an empty list when the first response is empty.
- Introduced `!empty` case in `ApiConnection.cs` to process empty responses.
- Created `ApiEmptySentence` class to manage empty response types, enhancing API functionality.
Copy link
Copy Markdown
Contributor

@Deantwo Deantwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks elegant and follows the same conventions as already used in the project.

@luposky
Copy link
Copy Markdown

luposky commented Mar 19, 2025

Hi,
Do you have any idea on the timing of the release of this version? For me it has become a blocker and it would be nice to have a new release of the library.

@Deantwo
Copy link
Copy Markdown
Contributor

Deantwo commented Mar 19, 2025

Hi, Do you have any idea on the timing of the release of this version? For me it has become a blocker and it would be nice to have a new release of the library.

The original maintainer of this project has been MIA for a few years now. So there likely won't be any updates to the original NuGet package, unless he suddenly returns.

But you can download the master from https://github.com/Deantwo/tik4net or https://github.com/xPucTu4/tik4net and compile it yourself instead, since they both have this and my other changes already.

@luposky
Copy link
Copy Markdown

luposky commented Mar 19, 2025

Thanks for the quick and precise answer, I was not aware of this fact, I would have waited months before realizing it.
Thanks again, I just add that as an end user it would be nice if someone published an updated version on nuget (maybe a tik4netv2) and continued this project.

@xPucTu4
Copy link
Copy Markdown
Contributor Author

xPucTu4 commented Mar 19, 2025

I actually published it a while ago:
SinisterDev.Tik4Net 3.5.19-pre - we use it in few active projects already
and
SinisterDev.Tik4Net 3.5.20-pre - changed targeting, needs testing

It's not showing up in searches because I haven’t had time to set up a public GitHub repo and a proper build/publish pipeline yet. If anyone is willing to help with this, it would be greatly appreciated!

@danikf danikf merged commit 18b164b into danikf:master Jan 4, 2026

namespace tik4net.Api
{
internal class ApiEmptySentence : ApiReSentence, ITikDoneSentence
Copy link
Copy Markdown
Contributor

@Deantwo Deantwo Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that you are using ApiReSentence and ITikDoneSentence here. You should probably have made a ITikEmptySentence class.

I guess this does make it more hacky than I originally thought now that I work more with it.
I assume it breaks the ExecuteSingleRow and ExecuteSingleRowOrDefault methods, since it will look like a ApiReSentence is returned, but it is empty.

danikf added a commit that referenced this pull request May 12, 2026
ApiConnection already skips !empty by recursing (case "!empty": return ReadSentence()).
The ApiEmptySentence class introduced by PR #105 is never instantiated, so remove it
and the dead check in ApiCommand to keep the codebase clean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for !empty Response Type in API Queries (RouterOS v7.18)

4 participants