Skip to content

Conversation

@winrid
Copy link
Contributor

@winrid winrid commented Nov 20, 2025

Fixes #22404

Was seeing segfaults on nullable fields that were actually set to null at runtime.
Switches to boost optional, which seems to be the best way to go, or I can add guards instead of we prefer that.

@ravinikam @stkrwork @etherealjoy @MartinDelille @muttleyxd @aminya

@muttleyxd
Copy link
Contributor

I like the idea, however we have std::optional since C++17, so I'd suggest to use that - it's been in standard for 8 years and it doesn't require external libraries

@winrid
Copy link
Contributor Author

winrid commented Nov 21, 2025

@muttleyxd The sdk's min compile target listed in cmake-lists is 11, should we update it?

Looks like sometimes cpp11 will work, unless you use anyOf... or now optional...

FYI the library already depends on boost, and the compile time for this header should be the same as std. I wasn't sure how far back we really want to go in terms of support so I did the safe thing. I guess I will change it.

@muttleyxd
Copy link
Contributor

Oh, I haven't looked into this generator recently (in last few years 😅), I guess if we keep it at C++11 and Boost is already there, then it's fine

@winrid
Copy link
Contributor Author

winrid commented Nov 21, 2025

it's ok :) I will do whatever people want me to do. Personally I don't think consumers of my sdk will be using anything older than 17...

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.

[BUG][cpp-rest] nullable string fields causes segfault

2 participants