You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Model generated for schema which takes one of object and array of object, does not compile. []Link in below code is not valid variable name.
// Link struct for Link
type Link struct {
Href *string `json:"href,omitempty"`
}
// LinksValueSchema - struct for LinksValueSchema
type LinksValueSchema struct {
Link *Link
[]Link *[]Link
}
openapi-generator version
3.0
OpenAPI declaration file content or url
openapi: 3.0.0info:
version: '1.1.2'title: 'Test Service'description: | Test Service.servers:
- url: '{apiRoot}/nfm/v1'variables:
apiRoot:
default: https://example.compaths:
/nf-instances:
get:
summary: Retrieves a collection of InstancesoperationId: GetInstancestags:
- Instances (Store)parameters:
- name: limitin: querydescription: How many items to return at one timerequired: falseschema:
type: integerresponses:
'200':
description: Expected response to a valid requestcontent:
application/3gppHal+json:
schema:
type: objectproperties:
_links:
type: objectdescription: 'List of the URI of instances. It has two members whose names are item and self. additionalProperties: $ref: '#/components/schemas/LinksValueSchema'minProperties: 1components:
schemas:
Link:
type: objectproperties:
href:
type: stringLinksValueSchema:
oneOf:
- type: arrayitems:
$ref: '#/components/schemas/Link'minItems: 1
- $ref: '#/components/schemas/Link'
Generation Details
Steps to reproduce
~/bin/openapitools/openapi-generator-cli generate -g go -o ~/test_dir/ -i test.yaml
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
Model generated for schema which takes one of object and array of object, does not compile. []Link in below code is not valid variable name.
openapi-generator version
3.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
~/bin/openapitools/openapi-generator-cli generate -g go -o ~/test_dir/ -i test.yaml
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: