mulesoft-labs / api-console-cli

A CLI tools for the API console.
Other
14 stars 15 forks source link

How to get validation errors? #29

Closed daniel-stockhausen closed 6 years ago

daniel-stockhausen commented 6 years ago

Hi,

I'm using api-console v3 additionally to api-console-cli, because api-console v3 validates and renders the RAML file in the browser and displays validation errors, if found.

api-console-cli just seems to keep rendering and most of the time the documentation looks fine in the browser, even if there were errors - because instead of any error message shown, invalid stuff just seems to be missing.

There doesn't seem to be a way to display validation errors when using api-console-cli, --verbose option also doesn't seem to print them.

Any suggestions?

Thanks!

jarrodek commented 6 years ago

Hi, Thank you for the issue report.

The console does not support validation nor we want it to support it. The idea is to allow to document as much as possible, event if RAML contains error. The console's target audience is API consumers that want to learn about the API. For API designers and API developers we have API design tools (API workbench, API designer) that render errors when writing the API model.

The CLI (and underlying builder module) does not test the API for validation. What I can suggest is to enable API validation on build time, print the warning and error messages to the output but continue the build. Would it solve your query?

Thanks Pawel

daniel-stockhausen commented 6 years ago

Hey Pawel!

thanks for your response. Yes, actually this would probably completely solve my problem. Of course it makes sense to render the documentation as good as possible, even if there are errors - I just would like to see them in the CLI - maybe with the verbose option or another additional option? That would be perfect for me :)

It would be great if you could implement anything like that!

Thank you :)

jarrodek commented 6 years ago

API validation message will be printed when verbose option is set when building the console with next version.

jarrodek commented 6 years ago

Actually, I lowered default logging level to warning messages so validation errors will always be send to the output.