uyuni-project / poc-uyuni-api

[Proof-of-Concept] Uyuni API Gateway. Provide REST-like API over XML-RPC
MIT License
0 stars 1 forks source link

Return an empty dictionary instead of nil #2

Open isbm opened 4 years ago

isbm commented 4 years ago

If Uyuni API is called via REST interface, then it currently returns nil instead of an empty return type which is actually expected. Most of the time (up to 99%) it is an empty JSON dictionary.

To fix this, generated specs should also contain return type. This is not yet implemented in the spec generator.

@paususe @admd @chiaradiamarcelo @joesusecom

paususe commented 4 years ago

Hey @isbm

Is that a custom Java parser?

isbm commented 4 years ago

Is that a custom Java parser?

In a hacking contest anything can happen. :wink: Yeah, I needed something get conceptually done literally in hours, so the concept works. I even started one in Java, but calculated that I will lose a lot of time to get something ready done, hence I crafted a very simple Python script that does the job good enough for now. But yes, this whole thing probably should be re-written in pure Java instead.

paususe commented 4 years ago

Is that a custom Java parser?

In a hacking contest anything can happen. wink Yeah, I needed something get conceptually done literally in hours, so the concept works. I even started one in Java, but calculated that I will lose a lot of time to get something ready done, hence I crafted a very simple Python script that does the job good enough for now. But yes, this whole thing probably should be re-written in pure Java instead.

Maybe use an existing Java parser? There's a ton of them

isbm commented 4 years ago

But that's what I just wrote. It would be better to be done in Java instead. I did it quick&dirty, but for production it surely should be done in a better way.