# REST / Swagger parameters not generated in code

**URL:** <https://forum.radzen.com/t/rest-swagger-parameters-not-generated-in-code/6062>\
**Category:** Blazor Server\
**Created:** [December 18, 2020, 12:27pm UTC](https://forum.radzen.com/t/rest-swagger-parameters-not-generated-in-code/6062 "2020-12-18T12:27:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat.stave](https://forum.radzen.com/user_avatar/forum.radzen.com/pat.stave/32/4923_2.png) [@pat.stave](https://forum.radzen.com/u/pat.stave)\
**Post date:** [December 18, 2020, 12:27pm UTC](https://forum.radzen.com/t/rest-swagger-parameters-not-generated-in-code/6062/1 "2020-12-18T12:27:15Z")

</div>

I have a data source where my parameters are defined like the snippet below. Note that there is 1 path parameter and 3 query parameters.

```
"/v0/MachineTypes/{machineTypeCode}/MachineEvents": {
  "get": {
    "tags": [
      "MachineEvents"
    ],
    "summary": "Gets all machine events matching optional machine event code or name filters.",
    "parameters": [
      {
        "name": "machineTypeCode",
        "in": "path",
        "description": "Machine type code of machine type to match.",
        "required": true,
        "type": "string"
      },
      {
        "name": "machineEventCodeFilter",
        "in": "query",
        "description": "Optional machine event code filter. Use the % character as wildcard. Default or null matches all machine events.",
        "type": "string"
      },
      {
        "name": "machineEventNameFilter",
        "in": "query",
        "description": "Optional machine event name filter. Use the % character as wildcard. Default or null matches all machine events.",
        "type": "string"
      },
      {
        "name": "includeDeactivated",
        "in": "query",
        "description": "Set to true to include deactivated machine events in the response.",
        "default": false,
        "type": "boolean"
      }
    ],
    "responses": {
      "200": {
        "description": "Success",
        },
        "schema": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MachineEventResponse"
          }
        }
      },
      "400": {
        "schema": {
          "$ref": "#/definitions/ValidationProblemDetails"
        }
      },
      "500": {
        "description": "Server Error",
        "schema": {
          "$ref": "#/definitions/ErrorResponse"
        }
      }
    },
    "produces": [
      "text/plain",
      "application/json",
      "text/json"
    ],
    "operationId": "getV0MachineTypesMachineTypeCodeMachineEvents"
  },

```

No matter what i do Radzen will not generate code for all parameters i have specified. Therefore the compilation fails.

When i define my data source method like this:

 ![image](https://forum.radzen.com/uploads/default/original/2X/b/b3ac00259d7f3ce1fab0286e2c8592efdf20dd0e.png)

This code is generated. Why is only one parameter generated in code? Why are the three others ignored?

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 18, 2020, 12:31pm UTC](https://forum.radzen.com/t/rest-swagger-parameters-not-generated-in-code/6062/2 "2020-12-18T12:31:22Z")

</div>

In my opinion also at the moment Radzen can work only with OData (described in OData specification) query parameters.

---

<div class="post-metadata">

**Author:** ![pat.stave](https://forum.radzen.com/user_avatar/forum.radzen.com/pat.stave/32/4923_2.png) [@pat.stave](https://forum.radzen.com/u/pat.stave)\
**Post date:** [December 18, 2020, 12:42pm UTC](https://forum.radzen.com/t/rest-swagger-parameters-not-generated-in-code/6062/3 "2020-12-18T12:42:29Z")

</div>

Are you saying it is impossible to achieve a GET request like this in Radzen, where bold are parameters? What part of this is not according to OData?

> localhost/v0/MachineTypes/ **ABC** /MachineEvents?machineTypeCode= **123** &machineEventCodeFilter= **123** &machineEventNameFilter= **123** &includeDeactivated= **false**

 ![image](https://forum.radzen.com/uploads/default/original/2X/0/0d52a2176c1c55a40f012b0d83e4dd3f14f385a2.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [December 18, 2020, 12:49pm UTC](https://forum.radzen.com/t/rest-swagger-parameters-not-generated-in-code/6062/4 "2020-12-18T12:49:08Z")

</div>

Yes, this is what I’m saying.  
UPDATE:  
Actually the problem turned to be with code generation of REST service methods with both path and query parameters. This will be fixed in the next update.

---

<div class="post-metadata">

**Author:** ![JohnnyOpcode](https://forum.radzen.com/letter_avatar_proxy/v4/letter/j/a183cd/32.png) [@JohnnyOpcode](https://forum.radzen.com/u/JohnnyOpcode)\
**Post date:** [May 18, 2021, 8:42pm UTC](https://forum.radzen.com/t/rest-swagger-parameters-not-generated-in-code/6062/5 "2021-05-18T20:42:43Z")

</div>

I think this may still be problematic. The code generation is missing one of three parameters I am specifying in a swagger call. I'm doing research still because I have been wrong before (quite often).

j.
