-
Notifications
You must be signed in to change notification settings - Fork 114
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
Dash (-) not supported in resource name #359
Comments
I will have to check the spec to see if |
We see here:
Which says
The requirements in the spec are pretty clear and should be simple to extract into a function instead of a regex test. Let me know what you think. |
You are correct @prshreshtha. You're welcome to submit a PR for review and eventual merging. |
Sounds good. I'll make one soon. |
It looks like GraphQL does not support dasherized field names. Any thoughts @pmcnr-hx? The same issue occurs with resources that start with a number. |
Ah, yes... I seemed to recall there was a reason not prevent dashes. One options is to replace the |
@paparomeo there are trade-offs here. I don't think replacing |
Thanks for the investigation @prshreshtha. I should have some time soon to look into adding support for disabling GraphQL. |
You can already do part of this. And there is an issue here for the entire task. #256 From my current implementation jsonApi.setConfig({
port: PORT,
base: `api/${API_ENV}/v${API_VERSION}`,
graphiql: true, // <-----------
swagger: {
title: "JSON:API Server",
version: "0.1.0",
description: "",
contact: {
name: "API Contact",
email: "[email protected]",
url: "example.com"
},
license: {
}
},
meta: function(request) {
return {
timestamp: parseInt(new Date().getTime()/1000),
schema: `api/${API_ENV}/v${API_VERSION}/swagger.json`,
};
}
}); |
@queenvictoria You are correct that #256 does cover part of this issue. It is a pre-requisite to supporting dasherized names. But I don't see any work done for it. |
The resource and attribute names are checked against the regex
/^[A-Za-z0-9_]*$/
. Is it possible to also support-
, i.e.resource-name-is-like-this
format? It could just be as easy as changing it to/^[A-Za-z0-9_\-]*$/
.The text was updated successfully, but these errors were encountered: