You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a use case where we call serverless framework from a language other than JS. for serverless invoke stepf... the output is a javascript object string (properties are not quoted)
This means that regular JSON parsers will break and you will need some JS interpreter in the middle to get a proper JSON out of this
i propose a new optional flag for all commands --jsonOutput/--output json that will tell the command that it needs to run its result through JSON.stringify before printing it to stdout/stderr
Additional Data
Serverless Framework Core Version you're using:3.35.2
The Plugin Version you're using:3.15.0
Operating System:node:18 (based on debian bookworm)
Stack Trace: N/A
Provider Error messages: N/A
The text was updated successfully, but these errors were encountered:
While looking into this i found another issue related to logging in invoke
in the serverless framework docs for plugin development it says
Best practices:
* stdout output is usually meant to be piped to/parsed by another program.
* Plugins should only write to stdout in commands they define (to avoid breaking the output of other commands).
* The only content written to stdout should be the main output of the command.
Take, for example, the serverless invoke command:
*Its output is the result of the Lambda invocation: by writing that result (and only that) to stdout, it allows any script to parse the result of the Lambda invocation.
*All other messages should be written to stderr: such logs are useful to humans, for example configuration warnings, upgrade notifications, Lambda logs… Since they are written to stderr, they do not break the parsable output of stdout.
invoke stepf uses the .log method and not the writeText(). this means that even if we decided to go with piping the output to another process we would need to filter out the rest of stderr output
This is a Feature Proposal
Description
We have a use case where we call serverless framework from a language other than JS. for
serverless invoke stepf...
the output is a javascript object string (properties are not quoted)This means that regular JSON parsers will break and you will need some JS interpreter in the middle to get a proper JSON out of this
i propose a new optional flag for all commands
--jsonOutput
/--output json
that will tell the command that it needs to run its result throughJSON.stringify
before printing it to stdout/stderrAdditional Data
The text was updated successfully, but these errors were encountered: