Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5623
Closed
Open
Issue created Mar 18, 2020 by Administrator@rootContributor0 of 1 checklist item completed0/1 checklist item

[BUG] C code does not compile when array in a form label:"Client C"

Created by: michelealbano

Bug Report Checklist

  • [ X ] Have you provided a full/minimal spec to reproduce the issue?
  • [ X ] Have you validated the input using an OpenAPI validator (example)?
  • [ X ] What's the version of OpenAPI Generator used?
  • [ X ] Have you search for related issues/PRs?
  • [ X ] What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

When I create a C client for a YAML containing a form with an array, the code of the library does not compile:

[ 14%] Building C object CMakeFiles/skycoin_rest_api/.dir/api/DefaultAPI.c.o In file included from /path/to/stuff/api/DefaultAPI.c:4: /path/to/stuff/api/DefaultAPI.h:13:69: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token 13 | DefaultAPI_walletTransaction(apiClient_t *apiClient ,list_t list_t * to); | ^ /path/to/stuff/api/DefaultAPI.c:17:69: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token 17 | DefaultAPI_walletTransaction(apiClient_t *apiClient ,list_t *list_t * to) | ^ make[2]: *** [CMakeFiles/skycoin_rest_api/.dir/build.make:128: CMakeFiles/skycoin_rest_api/.dir/api/DefaultAPI.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/skycoin_rest_api/.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

openapi-generator version

Current master.

OpenAPI declaration file content or url

https://gist.github.com/michelealbano/c7ef72864f8e4241e8478ab996a5a510

The yaml is a simplification of the one in issue #2338

Command line used for generation

java -jar /path/to/openapi-generator-cli.jar generate -g c -i /path/to/arrayinform.yaml

Steps to reproduce
mkdir build
cd build
cmake ..
make
Related issues/PRs

The yaml is a simplification of the one in issue #2338

Suggest a fix

I did a run with -DdebugOperations. I then analyzed api-body.mustache and api-header.mustache.

Need to solve the fact that the array activates both {{^isPrimitiveType}} and {{#isListContainer}}.

Assignee
Assign to
Time tracking