[Home]

Summary:ASTERISK-25406: Misc anomalies in Swagger definitions
Reporter:Lorenzo Emilitri (lenz.loway)Labels:
Date Opened:2015-09-20 10:57:18Date Closed:
Priority:MinorRegression?
Status:Open/NewComponents:Resources/res_ari
Versions:13.5.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) swagger.json
Description:I am rewriting the parser that generates ari4java bindings out of Swagger files, and I'm noticing a number of issues/anomalies. As Swagger files are supposed to be machine-parsed, they should match a given format without anomalies.

The following fields are/have typos:

Unrecognized field "defalutValue" (class ch.loway.oss.ari4java.codegen2.models.ApiParameter)
at [Source: ./codegen-data/ari_1_8_0/channels.json; line: 310, column: 25]

Unrecognized field "descriptioni" (class ch.loway.oss.ari4java.codegen2.models.ApiParameter)
at [Source: ./codegen-data/ari_1_8_0/endpoints.json; line: 58, column: 25]

Unrecognized field "descriptioni" (class ch.loway.oss.ari4java.codegen2.models.ApiParameter)
at [Source: ./codegen-data/ari_1_8_0/endpoints.json; line: 180, column: 25]

Unrecognized field "__note"
at [Source: ./codegen-data/ari_1_8_0/sounds.json

(Either we add a "note" field for good, or we'd better drop it).


I am also trying to generate enums to assist in code refactoring and making code clean where a parameter has a given set of values.

In general, restricted values are a mix of upper, lower and CamelCase, but some anomalies stand out (I print them here as :

EDeviceState=[BUSY, INUSE, INVALID, NOT_INUSE, ONHOLD, RINGING, RINGINUSE, UNAVAILABLE],
EDeviceStateState=[BUSY, INUSE, INVALID, NOT_INUSE, ONHOLD, RINGING, RINGINUSE, UNAVAILABLE, UNKNOWN],

- DeviceStates appear twice, with a different set of entries!


EChannelState=[Busy, Dialing, Dialing Offhook, Down, OffHook, Pre-ring, Ring, Ringing, Rsrved, Unknown, Up]}

- "Rserverd"?

Comments:By: Asterisk Team (asteriskteam) 2015-09-20 10:57:20.201-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Ben Merrills (skrusty) 2015-09-21 03:03:11.098-0500

Side note, it would be nice if we could standardise on 1.2 for the whole of the spec and not just Events.json.

By: David M. Lee (dlee) 2015-09-21 09:19:35.779-0500

FWIW, [~seanbright] has been working on upgrading the spec and parser to Swagger 2.0.

There was [some discussion of this on IRC|http://infobot.rikers.org/%23asterisk-dev/20150917.html.gz]

By: Sean Bright (seanbright) 2015-09-21 09:33:49.633-0500

I've attached the work-in-progress Swagger 2.0 spec for ARI. There are some things to clean up, like unique operationIds for everything. I don't have a lot of time to work on this at the moment, so I'd be fine with someone else running with it.