Skip to content
New issue

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

OpenAPI Service Proxy Project APIClient generated code has syntax errors in Java #43

Open
InfoSec812 opened this issue Jan 10, 2019 · 0 comments

Comments

@InfoSec812
Copy link

For example, one of the OpenAPI endpoints is:

  /photo:
    post:
      security:
      - ApiKeyAuth: []
      - BearerAuth: []
      description: Upload a new photo and get back the unique identifier
      operationId: addPhoto
      x-vertx-event-bus: svc.photo
      requestBody:
        content:
          image/*:
            schema:
              type: string
              format: binary
      responses:
        '202':
          description: Accepted the upload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageObject'
        '403':
          description: The authenticated user is not authorized to upload a photo

And the generated APIClient code looks like:

    public void addPhotoWithImage*Buffer(
        Buffer buffer, Handler<AsyncResult<HttpResponse>> handler) {
        // Check required params
        

        // Generate the uri
        String uri = "/photo";

        HttpRequest request = client.post(uri);

        MultiMap requestCookies = MultiMap.caseInsensitiveMultiMap();
        this.addHeaderParam("Content-Type", "image/*", request);
        this.attachApiKeyAuthSecurity(request, requestCookies);
        this.attachBearerAuthSecurity(request, requestCookies);
        

        this.renderAndAttachCookieHeader(request, requestCookies);
        request.sendBuffer(buffer, handler);
    }

The addPhotoWithImage*Buffer is not valid in Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant