Query parameter template includes default type integer/format int64
It would be better to have a more generic query parameter template (without the type) and then maybe offer types for integer/string etc. additionally? Currently each query parameter <> integer would have to be corrected (or add custom templates).
OpenAPI v3
I do see an int64 type in the OAS3 header parameter template:
name: ${name}
in: header
description: ${ID}
required: true
schema:
type: array
items:
type: ${integer}
format: int64
style: commaDelimited
Swagger v2
We also use the int64 in the path, header, query, and form data parameter templates for Swagger v2.
This change is easy and I think it makes sense. @tedepstein , should we add this issue to the current sprint?
Yes, I think the change makes sense. I've added it to the next sprint. To clarify scope:
- ~Does it affect both OpenAPI v2 and v3?~ (already answered)
- ~It affects both header and query parameter templates, but not path parameter templates, correct?~ (already answered)
- Do we want to keep the format property in our template, but make the format value a template variable, so you can choose the value during template completion?
I don't think this makes huge sense as for e.g. string this will be not needed. Better make a separate template for numeric types, where this makes sense?
BTW - the template idea & customization is great, I showed it at JCON here in Germany (http://jcon.one/de/) on Monday. It would be great to also have a property scope, to be able to add a prepared property template (rather than adding everything indiviually).
Pls let me know if you want a PR or do everything on your own.
@jfiala , thanks for the offer to submit a PR. We'd be very happy to have your contribution.
I don't think this makes huge sense as for e.g. string this will be not needed.
OpenAPI 3.0 defines formats for string, integer and number schemas.
Better make a separate template for numeric types, where this makes sense?
If you wanted to make separate templates for the types that have formats, and one generic template for types without formats, I think that would be fine.
BTW - the template idea & customization is great, I showed it at JCON here in Germany (http://jcon.one/de/) on Monday.
Cool, thanks!
It would be great to also have a property scope, to be able to add a prepared property template (rather than adding everything indiviually).
We have started making some improvements in the way code assist works for properties.
The ideas are described here.
Initial Implementation is in this pull request, recently merged. I'm not sure if it's in our current release yet.