-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Support server URL variables #182
Comments
@fmvilas hey, can you share some more explanation here, I'm not fully getting what can be done here. My first attempt would be to replace Or...maybe this |
I think it should go this way:
What do you think? |
I actually did not take into account that So default -> 1st enum -> warning 2 more questions:
I'm also thinking where later describe such functionality, so the user knows how it works without reading the templating. Or maybe it is enough to log clearly, that in case of default, log will say default was used, in case of enum, log will say first enum was used? |
Correct. That's only for code generation templates. So far, I'd only target the Node.js template.
Nope, no warnings yet. This would be a great use case for stoplightio/spectral#965. Actually, I'd forget about triggering warnings in the generator for now. Just go for: default -> 1st enum -> nothing (like now). If we're going to log warnings we should probably make them customizable, and that's a Spectral ruleset in the end. |
Currently, the generator doesn't support server URL variables. For instance, when we have a server like this:
The generated code tries to connect to
mqtt://test.mosquitto.org:{port}
. It would be great if it could replaceport
by a generated value, i.e., the default value or a valid one, based on the variable definition.The text was updated successfully, but these errors were encountered: