feat: Add LodgingBusiness schema type with hospitality-specific fields#29
Open
andreas-straub wants to merge 3 commits intoOperation-Nation:mainfrom
Open
feat: Add LodgingBusiness schema type with hospitality-specific fields#29andreas-straub wants to merge 3 commits intoOperation-Nation:mainfrom
andreas-straub wants to merge 3 commits intoOperation-Nation:mainfrom
Conversation
Add dedicated schema type for lodging/hospitality businesses with fields that are specific to accommodations: checkinTime, checkoutTime, petsAllowed, numberOfRooms, amenityFeature, starRating, email, currenciesAccepted, and paymentAccepted. Includes support for the following schema.org types: - LodgingBusiness (parent type) - BedAndBreakfast - Hotel - Hostel - Motel - Resort - VacationRental Previously, these types were listed under LocalBusiness but used the generic LocalBusiness pattern which lacks hospitality-specific properties. This change gives them a dedicated schema type with proper fields while keeping the same base properties (address, geo, openingHours, sameAs) from LocalBusiness. Changes: - New patterns: lodgingBusiness.ts, bedAndBreakfast.ts, hotel.ts, vacationRental.ts - New schema type: lodgingBusiness with LodgingBusinessListSelect dropdown - Updated detectSchemaType to route lodging types to dedicated pattern - Updated config with lodgingBusiness schema type name - Moved lodging types from localBusinessTypeList to dedicated list Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add petsAllowed and numberOfRooms to base lodgingBusiness pattern (fixes silent field stripping from JSON-LD output) - Remove dead-code sub-type pattern files (bedAndBreakfast, hotel, vacationRental) — base pattern covers all subtypes, consistent with how localBusiness handles its subtypes - Remove non-standard VacationRental type (not in schema.org), add Campground (valid schema.org LodgingBusiness subtype) - Add bestRating/worstRating to starRating for proper Google rich result rendering - Use TimePicker component for checkinTime/checkoutTime (consistent with openingHours handling, enforces HH:MM format) - Fix @type from hardcoded 'LodgingBusiness' to 'string' (consistent with localBusiness pattern convention) - Add schema.org reference comment to lodgingBusinessTypeList - Remove trailing commas from pattern file for style consistency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VacationRental (https://schema.org/VacationRental) is a stable Schema.org type inheriting from LodgingBusiness. It was incorrectly removed in the previous commit. Re-added to the lodging type list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a dedicated
LodgingBusinessschema type with hospitality-specific fields that were missing from the existingLocalBusinesstype. Previously, lodging subtypes (Hotel, Bed And Breakfast, Hostel, Motel) were listed in the LocalBusiness dropdown but used the generic LocalBusiness pattern, which lacks properties essential for accommodation structured data.New Schema Types
All schema.org LodgingBusiness subtypes:
New Hospitality-Specific Fields
These fields are available in addition to all existing LocalBusiness fields (address, geo, openingHours, sameAs, etc.):
checkinTimecheckoutTimepetsAllowednumberOfRoomsemailamenityFeatureLocationFeatureSpecificationitems (name + boolean value)starRatingRatingwithratingValue,bestRating(default "5"),worstRating(default "1")currenciesAcceptedpaymentAcceptedalternateNamedescriptionMotivation
Schema.org's LodgingBusiness type and its subtypes are widely used in Google Travel, Hotel Search, and rich results for accommodations. Properties like
checkinTime,checkoutTime,petsAllowed, andamenityFeatureare essential for these rich results but were not available in the generic LocalBusiness schema type.Changes
src/patterns/lodgingBusiness.ts— single pattern covering all lodging subtypes (consistent with howlocalBusiness.tscovers all LocalBusiness subtypes)src/schemas/types/lodgingBusiness/with dropdown selector, type list, and full field definitions including TimePicker for check-in/check-out timesdetectSchemaType.ts: Routes lodging types to dedicated pattern (checked before LocalBusiness)config.ts: AddedlodgingBusinesstoschemaTypeNamesschemas/types/index.ts: Registered new lodgingBusiness typelocalBusinessTypeList.ts: Removed lodging types (now in dedicated list)Breaking Change Note
Existing documents that used lodging types (Hotel, Bed And Breakfast, Hostel, Motel, Lodging Business) under the
LocalBusinessschema type will now be matched by the newLodgingBusinesspattern instead. The new pattern includes all fields fromLocalBusinessplus the hospitality-specific fields, so no data is lost. However, the JSON-LD output will now include additional empty fields if they were not previously filled in. Existing field values (name, address, geo, telephone, etc.) will continue to render correctly.Backward Compatibility
customSchemaconfig system (partial/full) works with the new typelodgingBusinesskey added toschemaTypeNamesfor renaming support