RepreZen / KaiZen-OpenAPI-Editor

Eclipse Editor for the Swagger-OpenAPI Description Language
Eclipse Public License 1.0
115 stars 12 forks source link

[#469] Fix Object resource template #470

Closed andylowry closed 6 years ago

andylowry commented 6 years ago

This realates to issue ZEN-4367 RepreZen JIRA

The Object resource template does not work well with reference string content-assist when filling in its itemSchema placeholder. The first instance of the placeholder is fine, but the next one has an extra quote in front of the ref string. This appears to be a problem with the content-assist implementation, not something that can be addressed by changing the template. So this commit does not fix the reported problem.

However, while investigating this issue, another bug in that template came to light, namely that the path parameter specified via the "id" plaaceholder in the template ends up without needed braces in the path string. This causes corresponding parameter definitions in contained operations to be in error.

This commit fixes the path string issue, but as to the reference string issue, it only makes quoting of ref strings consistent throughout the templates. Where ref strings are quoted, they are now always quoted with double quotes, whereas before there appeared to be a somewhat random use of double or single quotes.

tedepstein commented 6 years ago

@andylowry , these changes look worthwhile. I added some comments on the issue, and included a hack, in the form of a comment block with instructions on how to complete the unquoted schema reference using code assist. Maybe you can incorporate that here.