# Operations parameters

## Tags

You can group your API operations using `tags` argument (`list[str]`). 
```Python hl_lines="6"
@api.get("/hello/")
def hello(request, name: str):
    return {"hello": name}


@api.post("/orders/", tags=["orders"])
def create_order(request, order: Order):
    return {"success": True}

```

Tagged operations may be handled differently by tools and libraries. For example, Swagger UI uses tags to group the displayed operations.

![Summary`](../img/operation_tags.png)


## Operation Summary

Summary is a human readable name for your operation

By default it's generated by capitalizing your operation function name:

```Python hl_lines="2"
@api.get("/hello/")
def hello(request, name: str):
    return {"hello": name}
```

![Summary`](../img/operation_summary_default.png)

If you want to override it or translate to other language use `summary` argument in api decorator

```Python hl_lines="1"
@api.get("/hello/", summary="Say Hello")
def hello(request, name: str):
    return {"hello": name}
```

![Summary`](../img/operation_summary.png)

## Operation Description

If you need to provide more information about your operation - use either `description` argument or docstrings:


```Python hl_lines="1"
@api.post("/orders/", description="Creates an order and updates stock")
def create_order(request, order: Order):
    return {"success": True}
```

![Summary`](../img/operation_description.png)

When you need to provide long multiline description - you can as well use python `docstrings` for function definition:

```Python hl_lines="4 5 6 7"
@api.post("/orders/")
def create_order(request, order: Order):
    """
    To create an order please provide:
     - **first_name**
     - **last_name**
     - and **list of Items** *(product + amount)*
    """
    return {"success": True}

```

![Summary`](../img/operation_description_docstring.png)


## OpenAPI operationId

OpenAPI `operationId` is an optional unique string used to identify an operation. If provided, these IDs must be unique among all operations described in your API.

By default Django Ninja sets it to `module name` + `function name`

if you want ot set it individually for each operation use `operation_id` argument:

```Python hl_lines="2"
...
@api.post("/tasks", operation_id="create_task")
def new_task(request):
    ...
```

And if you want ot override global behavior - you can inherit NinjaAPI instance and override `get_openapi_operation_id` method

it will be called to each operation, that you defined, so you can set your custom naming logic

```Python hl_lines="5 6 7 9"
from ninja import NinjaAPI

class MySuperApi(NinjaAPI):

    def get_openapi_operation_id(self, operation):
        # here you can access operation ( .path , .view_func, etc) 
        return ...

api = MySuperApi()

@api.get(...)
...
```



## Deprecating Operation

If you need to mark an operation as deprecated without removing it, use the argument `deprecated`:

```Python hl_lines="1"
@api.post("/make-order/", deprecated=True)
def some_old_method(request, order: str):
    return {"success": True}
```

It will be marked as deprecated in the json schema an in the interactive docs:

![Deprecated](../img/deprecated.png)


