Generating code from the OpenAPI spec fails due to errors on the file

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 9.4.0, 9.6.0
    • Component/s: API - REST
    • Severity 3 - Minor

      Issue Summary

      Generating code from the OpenAPI spec fails due to errors on the file.

      Steps to Reproduce

      1. Download the spec or use its URL directly, depending on the tool
      2. Attempt to generate server side code from the spec in any language, as in the example below:

      Expected Results

      The code is generated successfully.

      Actual Results

      The code cannot be generated. If using Postman, it returns the message:

      Add a valid definition to generate code from it.
      

      If using openapi-generator-cli, it returns the following message, indicating issues with the spec file:

      Errors:
        -paths.'/api/latest/projects/{projectKey}/repos/{repositorySlug}/secret-scanning/exempt'. Declared path parameter projectKey needs to be defined as a path parameter in path or operation level
        -attribute paths.'/mirroring/latest/authenticate'(post).operationId is repeated
        -attribute paths.'/sync/latest/projects/{projectKey}/repos/{repositorySlug}'(get).operationId is repeated
        -paths.'/api/latest/projects/{projectKey}/repos/{repositorySlug}/secret-scanning/exempt'. Declared path parameter repositorySlug needs to be defined as a path parameter in path or operation level
        -attribute paths.'/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds'(get).operationId is repeated
        -paths.'/api/latest/projects/{projectKey}/secret-scanning/exempt'. Declared path parameter projectKey needs to be defined as a path parameter in path or operation level
      Warnings:
        -paths.'/api/latest/projects/{projectKey}/repos/{repositorySlug}/secret-scanning/exempt'. Declared path parameter projectKey needs to be defined as a path parameter in path or operation level
        -attribute paths.'/mirroring/latest/authenticate'(post).operationId is repeated
        -attribute paths.'/sync/latest/projects/{projectKey}/repos/{repositorySlug}'(get).operationId is repeated
        -paths.'/api/latest/projects/{projectKey}/repos/{repositorySlug}/secret-scanning/exempt'. Declared path parameter repositorySlug needs to be defined as a path parameter in path or operation level
        -attribute paths.'/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds'(get).operationId is repeated
        -paths.'/api/latest/projects/{projectKey}/secret-scanning/exempt'. Declared path parameter projectKey needs to be defined as a path parameter in path or operation level
      

      Workaround

      Currently, there is no known workaround for this behavior. A workaround will be added here when available

            Assignee:
            Unassigned
            Reporter:
            Bernardo Andreeti
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: