Skip to content

Commit

Permalink
ENH: json default exclude none,
Browse files Browse the repository at this point in the history
'@type' to start of serialized object
  • Loading branch information
crbaker89 committed Dec 7, 2021
1 parent 6907c3c commit 89b9175
Show file tree
Hide file tree
Showing 1,319 changed files with 3,218 additions and 4,512 deletions.
9 changes: 4 additions & 5 deletions pydantic_schemaorg/3DModel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import Field, StrictBool
from typing import Any, Union, List, Optional
from pydantic import StrictBool, Field
from typing import Any, Optional, Union, List
from pydantic_schemaorg.MediaObject import MediaObject


Expand All @@ -15,13 +15,12 @@ class _3DModel(MediaObject):
See https://schema.org/3DModel.
"""

type_: str = Field("3DModel", const=True, alias='@type')
isResizable: Optional[Union[List[StrictBool], StrictBool]] = Field(
None,
description="Whether the 3DModel allows resizing. For example, room layout applications often do"
"not allow 3DModel elements to be resized to reflect reality.",
)
locals().update({"@type": Field("3DModel", const=True)})



_3DModel.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AMRadioChannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class AMRadioChannel(RadioChannel):
See https://schema.org/AMRadioChannel.
"""

locals().update({"@type": Field("AMRadioChannel", const=True)})

type_: str = Field("AMRadioChannel", const=True, alias='@type')


AMRadioChannel.update_forward_refs()
7 changes: 3 additions & 4 deletions pydantic_schemaorg/APIReference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import Field
from typing import Any, Union, List, Optional
from typing import Any, Optional, Union, List
from pydantic_schemaorg.TechArticle import TechArticle


Expand All @@ -9,7 +9,7 @@ class APIReference(TechArticle):
See https://schema.org/APIReference.
"""

type_: str = Field("APIReference", const=True, alias='@type')
assemblyVersion: Optional[Union[List[str], str]] = Field(
None,
description="Associated product/technology version. e.g., .NET Framework 4.5.",
Expand All @@ -30,7 +30,6 @@ class APIReference(TechArticle):
None,
description="Type of app development: phone, Metro style, desktop, XBox, etc.",
)
locals().update({"@type": Field("APIReference", const=True)})



APIReference.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/Abdomen.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class Abdomen(PhysicalExam):
See https://schema.org/Abdomen.
"""

locals().update({"@type": Field("Abdomen", const=True)})

type_: str = Field("Abdomen", const=True, alias='@type')


Abdomen.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AboutPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class AboutPage(WebPage):
See https://schema.org/AboutPage.
"""

locals().update({"@type": Field("AboutPage", const=True)})

type_: str = Field("AboutPage", const=True, alias='@type')


AboutPage.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AcceptAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class AcceptAction(AllocateAction):
See https://schema.org/AcceptAction.
"""

locals().update({"@type": Field("AcceptAction", const=True)})

type_: str = Field("AcceptAction", const=True, alias='@type')


AcceptAction.update_forward_refs()
11 changes: 5 additions & 6 deletions pydantic_schemaorg/Accommodation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pydantic import Field, AnyUrl, StrictBool
from pydantic import StrictBool, Field, AnyUrl
from decimal import Decimal
from typing import Any, Union, List, Optional
from typing import Any, Optional, Union, List
from pydantic_schemaorg.LocationFeatureSpecification import LocationFeatureSpecification
from pydantic_schemaorg.Place import Place

Expand All @@ -15,7 +15,7 @@ class Accommodation(Place):
See https://schema.org/Accommodation.
"""

type_: str = Field("Accommodation", const=True, alias='@type')
numberOfBedrooms: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field(
None,
description="The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]]"
Expand Down Expand Up @@ -64,7 +64,7 @@ class Accommodation(Place):
description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]"
"or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.",
)
petsAllowed: Optional[Union[List[Union[str, StrictBool]], Union[str, StrictBool]]] = Field(
petsAllowed: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field(
None,
description="Indicates whether pets are allowed to enter the accommodation or lodging business."
"More detailed information can be put in a text value.",
Expand Down Expand Up @@ -96,7 +96,6 @@ class Accommodation(Place):
description="Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]."
"This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).",
)
locals().update({"@type": Field("Accommodation", const=True)})



Accommodation.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AccountingService.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class AccountingService(FinancialService):
See https://schema.org/AccountingService.
"""

locals().update({"@type": Field("AccountingService", const=True)})

type_: str = Field("AccountingService", const=True, alias='@type')


AccountingService.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AchieveAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class AchieveAction(Action):
See https://schema.org/AchieveAction.
"""

locals().update({"@type": Field("AchieveAction", const=True)})

type_: str = Field("AchieveAction", const=True, alias='@type')


AchieveAction.update_forward_refs()
7 changes: 3 additions & 4 deletions pydantic_schemaorg/Action.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pydantic import Field
from pydantic_schemaorg.Thing import Thing
from typing import Any, Union, List, Optional
from typing import Any, Optional, Union, List
from pydantic_schemaorg.Organization import Organization
from datetime import datetime, time

Expand All @@ -15,7 +15,7 @@ class Action(Thing):
See https://schema.org/Action.
"""

type_: str = Field("Action", const=True, alias='@type')
result: Optional[Union[List[Thing], Thing]] = Field(
None,
description="The result produced in the action. e.g. John wrote *a book*.",
Expand Down Expand Up @@ -75,7 +75,6 @@ class Action(Thing):
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
locals().update({"@type": Field("Action", const=True)})



Action.update_forward_refs()
15 changes: 7 additions & 8 deletions pydantic_schemaorg/ActionAccessSpecification.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from pydantic import Field, AnyUrl, StrictBool
from pydantic_schemaorg.Thing import Thing
from pydantic import StrictBool, Field, AnyUrl
from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory
from typing import Any, Union, List, Optional
from datetime import date, datetime, time
from pydantic_schemaorg.Thing import Thing
from typing import Any, Optional, Union, List
from datetime import datetime, time, date
from pydantic_schemaorg.Place import Place
from pydantic_schemaorg.Intangible import Intangible

Expand All @@ -13,8 +13,8 @@ class ActionAccessSpecification(Intangible):
See https://schema.org/ActionAccessSpecification.
"""

category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field(
type_: str = Field("ActionAccessSpecification", const=True, alias='@type')
category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field(
None,
description="A category for the item. Greater signs or slashes can be used to informally indicate a"
"category hierarchy.",
Expand Down Expand Up @@ -49,7 +49,6 @@ class ActionAccessSpecification(Intangible):
"the geo-political region(s) for which the offer or delivery charge specification is"
"not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]].",
)
locals().update({"@type": Field("ActionAccessSpecification", const=True)})



ActionAccessSpecification.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/ActionStatusType.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class ActionStatusType(StatusEnumeration):
See https://schema.org/ActionStatusType.
"""

locals().update({"@type": Field("ActionStatusType", const=True)})

type_: str = Field("ActionStatusType", const=True, alias='@type')


ActionStatusType.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/ActivateAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class ActivateAction(ControlAction):
See https://schema.org/ActivateAction.
"""

locals().update({"@type": Field("ActivateAction", const=True)})

type_: str = Field("ActivateAction", const=True, alias='@type')


ActivateAction.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/ActivationFee.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class ActivationFee(PriceComponentTypeEnumeration):
See https://schema.org/ActivationFee.
"""

locals().update({"@type": Field("ActivationFee", const=True)})

type_: str = Field("ActivationFee", const=True, alias='@type')


ActivationFee.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/ActiveActionStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class ActiveActionStatus(ActionStatusType):
See https://schema.org/ActiveActionStatus.
"""

locals().update({"@type": Field("ActiveActionStatus", const=True)})

type_: str = Field("ActiveActionStatus", const=True, alias='@type')


ActiveActionStatus.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/ActiveNotRecruiting.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class ActiveNotRecruiting(MedicalStudyStatus):
See https://schema.org/ActiveNotRecruiting.
"""

locals().update({"@type": Field("ActiveNotRecruiting", const=True)})

type_: str = Field("ActiveNotRecruiting", const=True, alias='@type')


ActiveNotRecruiting.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AddAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class AddAction(UpdateAction):
See https://schema.org/AddAction.
"""

locals().update({"@type": Field("AddAction", const=True)})

type_: str = Field("AddAction", const=True, alias='@type')


AddAction.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AdministrativeArea.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class AdministrativeArea(Place):
See https://schema.org/AdministrativeArea.
"""

locals().update({"@type": Field("AdministrativeArea", const=True)})

type_: str = Field("AdministrativeArea", const=True, alias='@type')


AdministrativeArea.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AdultEntertainment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class AdultEntertainment(EntertainmentBusiness):
See https://schema.org/AdultEntertainment.
"""

locals().update({"@type": Field("AdultEntertainment", const=True)})

type_: str = Field("AdultEntertainment", const=True, alias='@type')


AdultEntertainment.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AdvertiserContentArticle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class AdvertiserContentArticle(Article):
See https://schema.org/AdvertiserContentArticle.
"""

locals().update({"@type": Field("AdvertiserContentArticle", const=True)})

type_: str = Field("AdvertiserContentArticle", const=True, alias='@type')


AdvertiserContentArticle.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AerobicActivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class AerobicActivity(PhysicalActivityCategory):
See https://schema.org/AerobicActivity.
"""

locals().update({"@type": Field("AerobicActivity", const=True)})

type_: str = Field("AerobicActivity", const=True, alias='@type')


AerobicActivity.update_forward_refs()
11 changes: 5 additions & 6 deletions pydantic_schemaorg/AggregateOffer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic import Field
from pydantic_schemaorg.Offer import Offer
from pydantic_schemaorg.Demand import Demand
from typing import Any, Union, List, Optional
from pydantic_schemaorg.Offer import Offer
from typing import Any, Optional, Union, List
from decimal import Decimal


Expand All @@ -15,8 +15,8 @@ class AggregateOffer(Offer):
See https://schema.org/AggregateOffer.
"""

offers: Optional[Union[List[Union[Offer, Demand]], Union[Offer, Demand]]] = Field(
type_: str = Field("AggregateOffer", const=True, alias='@type')
offers: Optional[Union[List[Union[Demand, Offer]], Union[Demand, Offer]]] = Field(
None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
Expand All @@ -43,7 +43,6 @@ class AggregateOffer(Offer):
None,
description="The number of offers for the product.",
)
locals().update({"@type": Field("AggregateOffer", const=True)})



AggregateOffer.update_forward_refs()
7 changes: 3 additions & 4 deletions pydantic_schemaorg/AggregateRating.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pydantic import Field
from typing import Any, Union, List, Optional
from typing import Any, Optional, Union, List
from pydantic_schemaorg.Thing import Thing
from pydantic_schemaorg.Rating import Rating

Expand All @@ -10,7 +10,7 @@ class AggregateRating(Rating):
See https://schema.org/AggregateRating.
"""

type_: str = Field("AggregateRating", const=True, alias='@type')
reviewCount: Optional[Union[List[int], int]] = Field(
None,
description="The count of total number of reviews.",
Expand All @@ -23,7 +23,6 @@ class AggregateRating(Rating):
None,
description="The item that is being reviewed/rated.",
)
locals().update({"@type": Field("AggregateRating", const=True)})



AggregateRating.update_forward_refs()
5 changes: 2 additions & 3 deletions pydantic_schemaorg/AgreeAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class AgreeAction(ReactAction):
See https://schema.org/AgreeAction.
"""

locals().update({"@type": Field("AgreeAction", const=True)})

type_: str = Field("AgreeAction", const=True, alias='@type')


AgreeAction.update_forward_refs()
Loading

0 comments on commit 89b9175

Please sign in to comment.