# Fern Python SDK oddities

**URL:** <https://developer.squareup.com/forums/t/fern-python-sdk-oddities/23327>\
**Category:** Questions\
**Tags:** sdk\
**Created:** [July 24, 2025, 3:01am UTC](https://developer.squareup.com/forums/t/fern-python-sdk-oddities/23327 "2025-07-24T03:01:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![postolati-oksana](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@postolati-oksana](https://developer.squareup.com/forums/u/postolati-oksana)\
**Post date:** [July 24, 2025, 3:01am UTC](https://developer.squareup.com/forums/t/fern-python-sdk-oddities/23327/1 "2025-07-24T03:01:06Z")

</div>

When building FastAPI client I use provided types for typehints and OpenAPI schema, this however has some amount of weirdness:

1. Many model docstrings has `_` symbol escaped, this results in numerous warnings happening when importing a related module:

```auto
/usr/local/lib/python3.12/site-packages/square/requests/invoice.py:143: SyntaxWarning: invalid escape sequence '\_'
  For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles
/usr/local/lib/python3.12/site-packages/square/requests/invoice_payment_request.py:54: SyntaxWarning: invalid escape sequence '\_'
  of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC
/usr/local/lib/python3.12/site-packages/square/types/invoice.py:144: SyntaxWarning: invalid escape sequence '\_'
  For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles
/usr/local/lib/python3.12/site-packages/square/types/invoice_payment_request.py:55: SyntaxWarning: invalid escape sequence '\_'
  of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC
/usr/local/lib/python3.12/site-packages/square/requests/external_payment_details.py:21: SyntaxWarning: invalid escape sequence '\_'
  - OTHER\_GIFT\_CARD - Paid using a non-Square gift card.
/usr/local/lib/python3.12/site-packages/square/types/external_payment_details.py:22: SyntaxWarning: invalid escape sequence '\_'
  - OTHER\_GIFT\_CARD - Paid using a non-Square gift card.
/usr/local/lib/python3.12/site-packages/square/requests/destination_details_external_refund_details.py:19: SyntaxWarning: invalid escape sequence '

```

1. Confusingly, all models have typing.Optional[_some type here_] = pydantic.Field(default=None) set on all fields. And the model itself subclasses custom `UncheckedBaseModel`.  
Not sure what exactly is patched, but this completely breaks OpenAPI schema generator, which in turn resolves all type definition to Any:

```auto
Money {}
Payment {}
PaymentRefund	{}

```

Is it possible to update Fern configuration so that information is generated with proper typehints?

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [July 24, 2025, 3:01am UTC](https://developer.squareup.com/forums/t/fern-python-sdk-oddities/23327/2 "2025-07-24T03:01:24Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[GraphQL Basics](https://developer.squareup.com/docs/graphql/basics)**
>
> Learn about concepts, patterns and practices that apply when working with Square GraphQL.

> **[GraphQL Explorer](https://developer.squareup.com/docs/devtools/graphqlexplorer)**
>
> Describes Square GraphQL Explorer features and user interface, including setup steps and an overview of the schema.

> **Additional Documentation**
>
> [Square GraphQL](https://developer.squareup.com/docs/devtools/graphql)  
> [Build your First GraphQL Query](https://developer.squareup.com/docs/graphql/build-your-first-query)  
> [Frontend and Backend Development](https://developer.squareup.com/docs/build-basics/frontend-backend-development)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![lisa845jyorg](https://avatars.discourse-cdn.com/v4/letter/l/c37758/32.png) [@lisa845jyorg](https://developer.squareup.com/forums/u/lisa845jyorg)\
**Post date:** [August 4, 2025, 9:42am UTC](https://developer.squareup.com/forums/t/fern-python-sdk-oddities/23327/3 "2025-08-04T09:42:10Z")

</div>

Hello,

Thanks for share great guide but i have one question .  
Is the use of UncheckedBaseModel deliberate, and does it impact schema generation? Should I be subclassing from a different base to get proper OpenAPI types? [hctra org](https://www.hctra.it.com)

Best Regard,  
Lisa

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 4, 2025, 9:08pm UTC](https://developer.squareup.com/forums/t/fern-python-sdk-oddities/23327/4 "2025-08-04T21:08:59Z")

</div>

The team is looking into this. 🙂
