Open ms14981 opened 1 year ago
One thing to note here, the test-generators
command operates a little differently from the forge
command.
With the test-generators
command you specify which generators you would like to test, however, these are not installed via the 'resolver', instead they are expected to be available locally, and in the same folder as the forge.
This was originally done in order to simplify the relationship between the two. Previously generators had a dependency on openapi-forge
which meant that they installed them (in an npm_modules
) sub-folder, which resulted in a confused situation, whereby there was both a 'global' openapi-forge
(which runs the test-generators
command), and local copies for each generator.
Of course, the current situation, where the two commands perform differently isn't ideal.
Assuming a file path
blah/forge/openapi-forge-javascript/package.json
andblah/forge/openapi-forge/package.json
with the following commands run from theblah/forge/openapi-forge
directory.We are running the commands from the same location. The generator is installed in the same directory. But the
generator-options
command requires../
whereastest-generators
doesn't! See also https://github.com/ScottLogic/openapi-forge/pull/186To complicate matters, if openapi-forge is installed globally, then the relative path is interpreted as relative to the location that the openapi-forge global package is installed, which would only work if the generator is also installed globally:
TODO: