Skip to content

Generate .jmx (Jmeter file) from .yaml #8313

@mickteul

Description

@mickteul

Hi everyone, I try to create my own template (api.mustache) in order to generate a .jmx (Jmeter test file) to test my API REST.
My problem is to collect aproperties of a body type object parameter.

Here is a part of my .yaml :

/dossiers/{dossierId}/dossiers:
    post:
      tags:
      - DossierService
      summary: Ajouter un sous-dossier.
      operationId: addDossier
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - name: dossier
        in: body
        required: true
        schema:
          type: object
          required:
          - name
          properties:
            name:
              type: string
              maxLength: 200
              description: Le nom du nouveau dossier.

I want to extract the string "name" who is in properties of parameter "Dossier", but I can't do that...

When I use this code in my api.mustache, my variable {{basename}} is equal at "Dossier"...

{{#operations}}
{{#operation}}
{{#bodyParams}}
			   <elementProp name="{{baseName}}" elementType="HTTPArgument">
{{/bodyParams}}
{{/operation}}
{{/operations}}

I used DebugOperation et DebugModel to identify which variable I can use and i see my name variable in DebugModel but I can't use it (I tried use {{#models}}, {{#model}}, {{#var}}, etc...)

Somebody can help me ??

Mickael

Swagger-codegen version --> swagger-codegen-2.3.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions