We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Go module generated from a schema property like this:
times: type: array items: type: string format: date-time
is missing the import time statement and won't compile.
import time
4.1.2
openapi: 3.0.0 info: title: Sample OpenAPI Specification version: 0.0.1 servers: - url: http://localhost:8080/ description: Example API Service components: schemas: 'User': type: object required: - display_name - email properties: name: type: string readOnly: true display_name: type: string maxLength: 20 minLength: 1 email: type: string format: email times: type: array items: type: string format: date-time 'ErrorMessage': type: object required: - error_code - error_message properties: error_code: type: string error_message: type: string paths: /users/{user_id}: parameters: - name: user_id in: path description: ID of a user required: true schema: type: string get: description: Gets a user operationId: get_user responses: '200': description: User found content: 'application/json': schema: $ref: '#/components/schemas/User' 'default': description: Unexpected error content: 'application/json': schema: $ref: '#/components/schemas/ErrorMessage'
openapi-generator generate -g go -i api.yaml -o go/
model_user.go
Tentative fix: #3973
In postProcessModels function, when checking if the base type for a property is time.Time it should also check whether it's []time.Time.
postProcessModels
time.Time
[]time.Time
The text was updated successfully, but these errors were encountered:
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Bug Report Checklist
Description
The Go module generated from a schema property like this:
is missing the
import time
statement and won't compile.openapi-generator version
4.1.2
OpenAPI declaration file content or url
Command line used for generation
openapi-generator generate -g go -i api.yaml -o go/
Steps to reproduce
model_user.go
and notice the missing importRelated issues/PRs
Tentative fix: #3973
Suggest a fix
In
postProcessModels
function, when checking if the base type for a property istime.Time
it should also check whether it's[]time.Time
.The text was updated successfully, but these errors were encountered: