# OpenApi how to annotate T class/variables

**URL:** <https://forum.payara.fish/t/openapi-how-to-annotate-t-class-variables/269>\
**Category:** Technical Discussion\
**Created:** [March 23, 2022, 10:09am UTC](https://forum.payara.fish/t/openapi-how-to-annotate-t-class-variables/269 "2022-03-23T10:09:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SmallOS](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@SmallOS](https://forum.payara.fish/u/SmallOS)\
**Post date:** [March 23, 2022, 10:09am UTC](https://forum.payara.fish/t/openapi-how-to-annotate-t-class-variables/269/1 "2022-03-23T10:09:58Z")

</div>

Hi, I tried using openapi and everything was smooth till I encoutered small problem with `T`.  
Classes:

```auto
public class RestResponse extends BasicOperation {

    private RulesData rulesData;

    private ResultList<Device> resultList;
}

```

```auto
public class ResultList<T> extends BasicOperation {
    private List<T> dataList;

    public ResultList(Status status, Value value, boolean isExpanded) {
        super(status, value, isExpanded);
    }
}

```

What I get from /openapi

```auto
[...]
RestResponse:
      type: object
      properties:
        rulesData:
          $ref: '#/components/schemas/RulesData'
        resultList:
          $ref: '#/components/schemas/ResultList'
        value:
          $ref: '#/components/schemas/Value'
        isExpanded:
          type: boolean
        code:
          type: string
        error:
          type: string
        status:
          $ref: '#/components/schemas/Status'
      allOf:
      - $ref: '#/components/schemas/BasicOperation'
[...]
    ResultList:
      type: object
      properties:
        dataList:
          items:
            type: object
        value:
          $ref: '#/components/schemas/Value'
        isExpanded:
          type: boolean
        code:
          type: string
        error:
          type: string
        status:
          $ref: '#/components/schemas/Status'
      allOf:
      - $ref: '#/components/schemas/StandardResponse'
[...]

```

What I expect to get is something like this?

```auto
[...]
 ResultList:
      type: object
      properties:
        dataList:
          items:
            type: object
            ref: -$ '#/components/schemas/Device'
[...]

```

or

```auto
[...]
RestResponse:
      type: object
      properties:
        rulesData:
          $ref: '#/components/schemas/RulesData'
        resultList:
          $ref: '#/components/schemas/ResultList<Device>'
[...]

```

So what I need from openApi? Well something to describe classes used in ResultList e.g `Device` or any other class thats going to be used instead of `T` and Im not sure how to do it.

Versions:  
jdk: 11.0.11  
OpenApi: 3.0.0  
Payara: 5.20222.1
