-
Notifications
You must be signed in to change notification settings - Fork 465
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
Swagger JSON cannot parse Array of Hash in params #895
Comments
Interesting. Could a config option resolve the problem ? |
Also experiencing this issue. |
@RIstiaque Are you planning to open a pull request with the fix you found? any reason to keep that raise given some setting options ? or we should just allow it as you are using it? |
quickfix without forking to allow # config/initializers/apipie.rb
Apipie::ParamDescription.prepend(Module.new do
POINTLESS_ERROR = "an ':array_of =>' validator is allowed exclusively on response-only fields"
def raise(arg1, ...)
super unless arg1 == POINTLESS_ERROR
end
end) |
When inputting the following code for a method:
It outputs the following after running this command:
rails apipie:static_swagger_json
:However in the response, there is the
array_of
property which allows me to make anarray_of: Hash
:Which results in the following:
Is there a reason that the
array_of
is only limited to responses?After forking and cloning APIPie locally, I uncommented this line:
apipie-rails/lib/apipie/param_description.rb
Line 93 in 7cc859e
And was able to get the first piece of code working after refactoring to
array_of: Hash
.The text was updated successfully, but these errors were encountered: