Skip to content
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

BUG: can't read yaml stub files #330

Closed
Muntasir2001 opened this issue Jul 8, 2024 · 4 comments · Fixed by #332 or #331
Closed

BUG: can't read yaml stub files #330

Muntasir2001 opened this issue Jul 8, 2024 · 4 comments · Fixed by #332 or #331
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Muntasir2001
Copy link

Hi,

I have been trying to use Gripmock with yaml as the stub file but its showing this error.

Screenshot 2024-07-08 at 18 39 26

I have tried numerous ways of creating a gripmock service in docker compose and even tried to spin up the service without using docker compose but nothing worked. I have also tried one of your older version of gripmock which didn't work either.

Here are all the files that I have used to create a Gripmock service:

# docker-compose.yaml

services:
  gripmock:
    image: bavix/gripmock:2.6.13
    volumes:
      - ./proto:/proto
      - ./stubs:/stubs:ro
    ports:
      - '4770:4770' # GRPC server
      # - '4771:4771' # Stub server API
    command: ['--stub=/stubs' ,'/proto/hello.proto']
# stubs/hello.yml

service: Gripmock
method: SayHello
input:
  equals:
    name: tokopedia-single
output:
  data:
    message: Hello Tokopedia
    return_code: 1
// proto/hello.proto
syntax = "proto3";
option go_package = "github.com/bavix/gripmock/protogen/example/simple";

package simple;

service Gripmock {
  rpc SayHello (Request) returns (Reply);
}

message Request {
  string name = 1;
}

message Reply {
  string message = 1;
  int32 return_code = 2;
}

Note: one of my colleague also tried it on his machine and it didn't work either. I have M1 pro Macbook and my colleague has intel core i5 Macbook.

@rez1dent3
Copy link
Member

@Muntasir2001 hello. Thank you very much for the feedback.

Indeed, this leads to an unpleasant bug. I'll try to fix it soon.

For now you can replace with an array:

-
  service: Gripmock
  method: SayHello
  input:
    equals:
      name: tokopedia-single
  output:
    data:
      message: Hello Tokopedia
      return_code: 1

@rez1dent3
Copy link
Member

I'll write when a new version with a patch comes out

@rez1dent3 rez1dent3 self-assigned this Jul 8, 2024
@rez1dent3 rez1dent3 added bug Something isn't working good first issue Good for newcomers labels Jul 8, 2024
@Muntasir2001
Copy link
Author

Great, thanks

@rez1dent3
Copy link
Member

@Muntasir2001 Tag v2.6.15

https://github.com/bavix/gripmock/releases/tag/v2.6.15

Thanks a lot

This was linked to pull requests Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants