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

Optional parameters being sent as encoded #25

Open
davemackintosh opened this issue Oct 9, 2015 · 0 comments
Open

Optional parameters being sent as encoded #25

davemackintosh opened this issue Oct 9, 2015 · 0 comments

Comments

@davemackintosh
Copy link

I have a route defined as

{
  method: "GET",
  path: `/${model_name}/{id?}`,
  config: {
    handler: Functions.GET.bind(models[model_name]),
    description: `Get a paginated list of "${model_name}"`,
    notes: `Return a list of "${model_name}" in the database. If an ID is passed, return matching documents.`,
    tags: ["api", model_name],
    validate: {
      params: Joi.object({
        id: Joi.string().optional().description(`ID of the ${model_name} to get`)
      })
    },
    response: {
      schema: Joi.array().items(reply_joi)
        .meta({
          className: `Get ${model_name}`
        })
    }
  }
},

But the UI shows the ID without the optional flag ? and sends the request as %7Bid%7D

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

1 participant