thunderbird / thunderbird-notifications

In-App notifications for Thunderbird
Mozilla Public License 2.0
0 stars 1 forks source link

Capture less formal conventions in generated schema #19

Closed radishmouse closed 1 month ago

radishmouse commented 2 months ago

It would be better if the schema generated by Pydantic could be used instead of the hand-written schema.json.

However, per this discussion, it doesn't capture the less formal conventions that are included in the hand-written one.

This ticket is for investigating how we could improve the generated schema.


For this ticket:

for example:

from pydantic import Field
from pydantic.dataclasses import dataclass

@dataclass
class DataclassWithDescription:
   a_field: int = Field(description="descr text")
radishmouse commented 2 months ago

@freaktechnik Do you recall some of the conventions missing from the generated schema?

freaktechnik commented 1 month ago

https://github.com/thunderbird/thunderbird-notifications/blob/132a40012cc48eeb89211bae578f96d47c3bce17/schema.json#L16 https://github.com/thunderbird/thunderbird-notifications/blob/132a40012cc48eeb89211bae578f96d47c3bce17/schema.json#L21 specify the timezone - though for our parsing on the client side it's fine as long as it has a timezone...


https://github.com/thunderbird/thunderbird-notifications/blob/132a40012cc48eeb89211bae578f96d47c3bce17/schema.json#L25 https://github.com/thunderbird/thunderbird-notifications/blob/132a40012cc48eeb89211bae578f96d47c3bce17/schema.json#L29 have qualifiers of text length (even if only very rough)


https://github.com/thunderbird/thunderbird-notifications/blob/132a40012cc48eeb89211bae578f96d47c3bce17/schema.json#L42 describes which is the more urgent severity

radishmouse commented 1 month ago

Closed by https://github.com/thunderbird/thunderbird-notifications/pull/28