Skip to content

Endpoint parameters not parsed #122

Closed
@rombru

Description

@rombru

Hi,

I've found that parameters written at endpoint level are not parsed.
Here is an example

openapi-processor-mapping: v2

options:
  package-name: be.unamur.nuts.web.api
  javadoc: true
openapi: 3.0.2
info:
  title: nuts
  version: '1.0'
  contact: {}
  description: 'Test bug'
servers:
  - url: 'http://localhost:8080'
tags:
  - name: user
    description: Everything about users
paths:
  '/users/{userId}':
    parameters:
      - schema:
          type: integer
        name: userId
        in: path
        required: true
        description: Id of an existing user.
    get:
      summary: Get User Info by User ID
      tags:
        - user
      responses:
        '200':
          description: User Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
              examples:
                Get User Alice Smith:
                  value:
                    id: 142
                    firstName: Alice
                    lastName: Smith
                    email: [email protected]
                    dateOfBirth: '1997-10-31'
                    emailVerified: true
                    signUpDate: '2019-08-24'
        '404':
          description: User Not Found
      operationId: get-users-userId
      description: Retrieve the information of the user with the matching user ID.

components:
  schemas:
    User:
      title: User
      type: object
      description: ''
      x-examples:
        Alice Smith:
          id: 142
          firstName: Alice
          lastName: Smith
      properties:
        id:
          type: integer
          description: Unique identifier for the given user.
        firstName:
          type: string
          description: The firstname of the user
        lastName:
          type: string
          description: The lastname of the user
      required:
        - lastName
  examples: {}

The result is the following Interface:

public interface UserApi {
    @GetMapping(
        path = {"/users/{userId}"},
        produces = {"application/json"}
    )
    User getUsersUserId();
}

spring processor version: 1.0.0.M20
maven plugin version: 1.0.0.M2

The userId should be used by the function

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions