Skip to content

Commit ad235fe

Browse files
committed
ensure backwards compatibility of credits price
1 parent 2d68532 commit ad235fe

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Models added here "cover" models from within the deployment in order to restore backwards compatibility
2+
3+
from typing import Annotated
4+
5+
from models_library.api_schemas_webserver.product import GetCreditPrice
6+
from models_library.basic_types import NonNegativeDecimal
7+
from pydantic import Field, NonNegativeFloat, PlainSerializer
8+
9+
10+
class GetCreditPriceApiServer(GetCreditPrice):
11+
usd_per_credit: Annotated[
12+
NonNegativeDecimal,
13+
PlainSerializer(float, return_type=NonNegativeFloat, when_used="json"),
14+
] | None = Field(
15+
...,
16+
description="Price of a credit in USD. "
17+
"If None, then this product's price is UNDEFINED",
18+
)

0 commit comments

Comments
 (0)