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

API should return json objects, not array #2

Open
1 of 2 tasks
ioggstream opened this issue Nov 13, 2019 · 4 comments
Open
1 of 2 tasks

API should return json objects, not array #2

ioggstream opened this issue Nov 13, 2019 · 4 comments

Comments

@ioggstream
Copy link
Contributor

ioggstream commented Nov 13, 2019

I expect

https://github.com/italia/pc-web-validator/blob/df0c77efb8497d39eb1b2db9e55613e34360fcf8/api_spec_oa3.yml#L75

Example

{
  "status": 422,
  "detail": "Malformed publiccode.yaml.",
  "errors": [ {"key": "", "reason": ""}]
}

Instead

It returns a json array, eg:

[ {"Key": "foo", "Reason": "Bar"}, {"Key": "foo1", "Reason": "Bar1"} ]

Note

This might be a breaking change.

@saniales
Copy link
Contributor

saniales commented Jul 7, 2020

Could you please elaborate again?

I would like to fix this, but I do not understand what you expect and what you have

@ioggstream
Copy link
Contributor Author

Hi @sebbalex, can you pls check how breaking is that?

@sebbalex
Copy link
Member

sebbalex commented Jul 8, 2020

ATM this api is consumed by publiccode-editor and of course, this will be a breaking change, but I agree with you @ioggstream it should returns an object instead a simple array. We can go ahead doing this change paying attention to have the PE already able to handle both modes

@sebbalex
Copy link
Member

@ioggstream later #25 can we consider this closed?

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

4 participants