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

apis create openapi --oasuri=... fails with Bad request #307

Closed
kurtkanaskie opened this issue Oct 2, 2023 · 0 comments · Fixed by #308
Closed

apis create openapi --oasuri=... fails with Bad request #307

kurtkanaskie opened this issue Oct 2, 2023 · 0 comments · Fixed by #308
Assignees
Labels
bug Something isn't working

Comments

@kurtkanaskie
Copy link
Collaborator

kurtkanaskie commented Oct 2, 2023

This issue surfaced in: apigeecli version 1.124.0-beta date: 2023-09-20T19:06:10Z [commit: 0ef1ca9]

For example:

$ apigeeclix apis create openapi --org=apigeex-mint-kurt --name=oas-test-cli --target-url=https://mocktarget.apigee.net --oasuri=https://raw.githubusercontent.com/kurtkanaskie/persons-v1/master/persons-v1.yaml
{
  "error": {
    "code": 400,
    "message": "bundle contains errors",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/edge.configstore.bundle.BadBundle",
        "violations": [
          {
            "filename": "/var/folders/gn/ln5n35xn7j7g9qsnfwg4qs8h00d7v8/T/proxy784746176/apiproxy/",
            "description": "zip entry in bundle is outside the bundle root"
          }
        ]
      },
      {
        "@type": "type.googleapis.com/google.rpc.RequestInfo",
        "requestId": "7034587758526831513"
      }
    ]
  }
}

ERROR: 2023/10/02 11:11:32 bundles.go:270: Bad Request - malformed request syntax
Error: Bad Request - malformed request syntax

Looking at the created zip I see:

$ unzip oas-test-cli.zip 
Archive: oas-test-cli.zip
warning:  stripped absolute path spec from /var/folders/gn/ln5n35xn7j7g9qsnfwg4qs8h00d7v8/T/proxy784746176/apiproxy/
   creating: var/folders/gn/ln5n35xn7j7g9qsnfwg4qs8h00d7v8/T/proxy784746176/apiproxy/
  inflating: apiproxy/gep-oas-test-cli.xml  
   creating: apiproxy/policies/
  inflating: apiproxy/policies/OAuth-v20-1.xml  
  inflating: apiproxy/policies/OpenAPI-Spec-Validation-1.xml  
  inflating: apiproxy/policies/Verify-API-Key-ApiKeyAuth.xml  
   creating: apiproxy/proxies/
  inflating: apiproxy/proxies/default.xml  
   creating: apiproxy/resources/
   creating: apiproxy/resources/oas/
  inflating: apiproxy/resources/oas/persons-v1.yaml  
   creating: apiproxy/targets/
  inflating: apiproxy/targets/default.xml  

Same issue if I use --oasfile

srinandan added a commit that referenced this issue Oct 3, 2023
@srinandan srinandan linked a pull request Oct 3, 2023 that will close this issue
@srinandan srinandan self-assigned this Oct 3, 2023
@srinandan srinandan added the bug Something isn't working label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants