Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

--config-data is partial to accepting JSON config data only, and not YAML #575

Open
sakshamsaxena opened this issue Feb 25, 2021 · 0 comments · May be fixed by #576
Open

--config-data is partial to accepting JSON config data only, and not YAML #575

sakshamsaxena opened this issue Feb 25, 2021 · 0 comments · May be fixed by #576

Comments

@sakshamsaxena
Copy link

I have a YAML like this:

protoc:
  version: 3.8.0
lint:
  group: uber2
generate:
  go_options:
    import_path: my-app/src/api/grpc
  plugins:
    - name: gogofaster
      type: gogo
      flags: plugins=grpc
      output: generated_model

This is quite biased as the import path is fixed here. Usually I have to generate it for the server app and client app which are different (and currently non-standardised). So I keep another copy of this with a different import_path.

I wanted to use prototool generate to generate for both the configs that are in YAML. However, when I run

prototool generate service_definition.proto --config-data "$(cat prototool-custom-1.yaml)"

i get the following error

prototool generate service_definition.proto --config-data "protoc:   version: 3.8.0 lint:   group: uber2 generate:   go_options:     import_path: my-app/src/api/grpc   plugins:     - name: gogofaster       type: gogo       flags: plugins=grpc       output: generated_model"
invalid character 'p' looking for beginning of value

This suggests that it is unable to parse YAML.

I checked #224 and noticed that the test cases also have JSON config as test data, so I'm guessing there's a gap here in what the expectations are and what the outcome is. I could not understand the code much, and am on a time crunch, so any insights on a workaround, or an acknowledgment that this is a bug, would be appreciated.

Thanks!

@sakshamsaxena sakshamsaxena linked a pull request Mar 26, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant