Skip to content
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

Using 'useDate=string' parameter; the response is still anticipating an object for Timestamp Wrapper #1025

Open
maddygoround opened this issue Apr 10, 2024 · 0 comments

Comments

@maddygoround
Copy link

maddygoround commented Apr 10, 2024

When using ts-proto for 'useDate=string', the types are correctly generated as 'string | undefined'. However, when sending the response, fields designated as 'google.protobuf.Timestamp' end up throwing an error: 'Error serializing response: .v1.expiresAt: object expected'

Additionally, setting 'useDate=true', the response displays field values in the format { seconds: number, nanos: number }

The proto message

message xyz {
  google.protobuf.Timestamp expires_at = 1;
  string id = 2;
}

The options used for type generations

paths=source_relative, outputServices=generic-definitions, outputClientImpl=false, useDate=string, outputJsonMethods=true, useJsonName=true, stringEnums=true, useExactTypes=false,nestJs=true

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

No branches or pull requests

1 participant