Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Fix generate.dart parameters #169

Open
tmst opened this issue Oct 14, 2016 · 0 comments
Open

Fix generate.dart parameters #169

tmst opened this issue Oct 14, 2016 · 0 comments

Comments

@tmst
Copy link

tmst commented Oct 14, 2016

generate.dart supports input and output directory parameters for both of its subcommands (package, files). This leads one to believe that it supports multiple discovery documents in the input directory. However, when multiple discovery documents exist, there is only a single client library file generated, which contains the API for only the last document it processed. AND the command's output indicates that both were processed successfully:

generate.dart files -i . -o .
[SUCCESS] my_api v1 @ . 
[SUCCESS] my_api v1 @ . 

I suggest that the files subcommand be changed to file and take an input file (JSON document) and output the library file to standard output, or take a filename as the output parameter.

Plus, the command help is unclear in its use of "already existing", implying that the discovery document might somehow as well be generated by the command.

Alternatively, the files subcommand might indeed process multiple discovery docs, each with a single service API generated using endpointscfg.py, and generate a client library containing the API for all services. This would be really nice for my use case, as I could then declare different clients in a more generic manner in my Dart code that uses the libraries, if that makes any sense:

import "my_api.dart" show MyFirstResourceApi, MySecond...
MyFirstApiResource firstApi;
MySecondResource secondApi;

Trying to do this with a multi-class API as currently generated gives me problems. But that's probably another matter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant