Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-20979

null operation name when using contract first api

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.7.0
    • 4.8.0
    • camel-rest-openapi
    • None
    • Unknown

    Description

      When using contract first rest dsl openapi the following yaml open api (taken from https://swagger.io/docs/specification/basic-structure/)

      openapi: 3.0.0
      info:
        title: Sample API
        description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
        version: 0.1.9
      servers:
        - url: http://api.example.com/v1
          description: Optional server description, e.g. Main (production) server
        - url: http://staging-api.example.com
          description: Optional server description, e.g. Internal staging server for testing
      paths:
        /users:
          get:
            summary: Returns a list of users.
            description: Optional extended description in CommonMark or HTML.
            responses:
              '200':    # status code
                description: A JSON array of user names
                content:
                  application/json:
                    schema: 
                      type: array
                      items: 
                        type: string
      

      generate the following log if missing routes are ignored

      2024-07-15T12:11:30.635+02:00  WARN 12918 --- [           main] .r.o.DefaultRestOpenapiProcessorStrategy : OpenAPI specification has 1 unmapped operations to corresponding routes: 
              direct:null
      This validation error is ignored.
      

      in particular, direct:null route has to be created, given that openrationId is not provided, is it expected? can route name be dynamically generated via $path + $verb?

      Attachments

        Issue Links

          Activity

            People

              klease78 Karen Lease
              Federico Mariani Federico Mariani
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: