Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to str for dl_type #133

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions db/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datetime import datetime
from decimal import Decimal
from enum import Enum
from typing import List, Optional
from typing import List, Optional, Union

from bson.decimal128 import Decimal128
from pydantic import BaseModel, Field, validator
Expand Down Expand Up @@ -50,7 +50,7 @@ class MatchSubDoc(BaseModel):
dl_src: Optional[str]
dl_dst: Optional[str]
dl_type: Optional[int]
dl_vlan: Optional[int]
dl_vlan: Union[int, str, None]
dl_vlan_pcp: Optional[int]
nw_src: Optional[str]
nw_dst: Optional[str]
Expand Down
8 changes: 5 additions & 3 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,11 @@ components:
type: string
example: '00:15:af:d5:38:98'
dl_type:
type: integer
format: int16
example: 2048
oneOf:
- type: integer
format: int32
- type: string
example: 2048, any
dl_vlan:
type: integer
format: int16
Expand Down