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

How to specify a response as a map? #562

Open
naddika opened this issue Sep 2, 2023 · 1 comment
Open

How to specify a response as a map? #562

naddika opened this issue Sep 2, 2023 · 1 comment

Comments

@naddika
Copy link

naddika commented Sep 2, 2023

Is there a way to specify a response as a map, with unknown keys, rather than a struct with the known ones? For instance:

  operation :data1,
    summary: "Balance info and some other info",
    parameters: [
      ......
    ],
    responses: [
      ok: {"Balance info and some other info", "application/json", MyAppSchemas.BalanceInfoEx}
  ]

===>

  operation :data1,
    summary: "Balance info and some other info",
    parameters: [
      ......
    ],
    responses: [
      # something like
      # 1
      # ok: {"Balance info and some other info", "application/json", %{}}
      # OR
      # 2
      ok: {"Balance info and some other info", "application/json", Map}
  ]
@zorbash
Copy link
Contributor

zorbash commented Sep 4, 2023

@naddika You can define a schema with type: :object and no required properties.

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

No branches or pull requests

2 participants