-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile Error with structs and useOptionals=all #578
Closed
cprovatas opened this issue
May 31, 2022
· 2 comments
· Fixed by #1008 · May be fixed by Graysonbarton/synthetics-sdk-nodejs#2
Closed
Compile Error with structs and useOptionals=all #578
cprovatas opened this issue
May 31, 2022
· 2 comments
· Fixed by #1008 · May be fixed by Graysonbarton/synthetics-sdk-nodejs#2
Labels
Comments
I have a hack right now to remove the optional annotation, which is gross but works const structPath = './src/proto/generated/google/protobuf/struct.pb.ts';
function fixGeneratedTypeScript(): void {
const contents = fs.readFileSync(structPath, 'utf8');
const result = contents
.replace('fields?:', 'fields:')
.replace('values?:', 'values:');
fs.writeFileSync(structPath, result, 'utf8');
} |
stephenh
pushed a commit
that referenced
this issue
Feb 28, 2024
Fixes #578 Due to the use of the `.foreach` function TS has no context of the clue that `struct.fields` is definently not undefined.
🎉 This issue has been resolved in version 1.167.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version 1.114.7
useOptionals=all
Doesn't seem to be properly handling struct fields. Either the generated struct code needs to add
?
unwrapping logic or it should remove the optionality on thefields
/values
properties.The text was updated successfully, but these errors were encountered: