Skip to content

Commit

Permalink
✨ Improve types + relation fields
Browse files Browse the repository at this point in the history
Improves types (example: `url` instead of `string`) and adds the
“relation” fields. All fields should exist now with two exceptions:
Wookiee encoding and JSON schema operations.
  • Loading branch information
connorjs committed Sep 10, 2023
1 parent bc828fb commit 5fa8c25
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 26 deletions.
23 changes: 19 additions & 4 deletions src/films.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ model Film {
title: string;

/** The episode number of this film. */
episode_id: integer;
episode_id: int32;

/** The opening paragraphs at the beginning of this film. */
opening_crawl: string;
Expand All @@ -42,12 +42,27 @@ model Film {
/** The ISO 8601 date format of film release at original creator country. */
release_date: plainDate;

/** An array of species resource URLs that are in this film. */
species: url[];

/** An array of starship resource URLs that are in this film. */
starships: url[];

/** An array of vehicle resource URLs that are in this film. */
vehicles: url[];

/** An array of people resource URLs that are in this film. */
characters: url[];

/** An array of planet resource URLs that are in this film. */
planets: url[];

/** The hypermedia URL of this resource. */
url: string;
url: url;

/** The ISO 8601 date format of the time that this resource was created. */
created: string;
created: utcDateTime;

/** The ISO 8601 date format of the time that this resource was edited. */
edited: string;
edited: utcDateTime;
}
20 changes: 16 additions & 4 deletions src/people.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,26 @@ model Person {
skin_color: string;

/** The URL of a planet resource, a planet that this person was born on or inhabits. */
homeworld: string;
homeworld: url;

/** An array of film resource URLs that this person has been in. */
films: url[];

/** An array of species resource URLs that this person belongs to. */
species: url[];

/** An array of starship resource URLs that this person has piloted. */
starships: url[];

/** An array of vehicle resource URLs that this person has piloted. */
vehicles: url[];

/** The hypermedia URL of this resource. */
url: string;
url: url;

/** The ISO 8601 date format of the time that this resource was created. */
created: string;
created: utcDateTime;

/** The ISO 8601 date format of the time that this resource was edited. */
edited: string;
edited: utcDateTime;
}
12 changes: 9 additions & 3 deletions src/planets.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ model Planet {
/** The percentage of the planet surface that is naturally occurring water or bodies of water. */
surface_water: string;

/** An array of People URL Resources that live on this planet. */
residents: url[];

/** An array of Film URL Resources that this planet has appeared in. */
films: url[];

/** The hypermedia URL of this resource. */
url: string;
url: url;

/** The ISO 8601 date format of the time that this resource was created. */
created: string;
created: utcDateTime;

/** The ISO 8601 date format of the time that this resource was edited. */
edited: string;
edited: utcDateTime;
}
12 changes: 6 additions & 6 deletions src/root.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ op root(): Root;
*/
model Root {
/** The URL root for Film resources. */
films: string;
films: url;

/** The URL root for People resources. */
people: string;
people: url;

/** The URL root for Planet resources. */
planets: string;
planets: url;

/** The URL root for Species resources. */
species: string;
species: url;

/** The URL root for Starships resources. */
starships: string;
starships: url;

/** The URL root for Vehicles resources. */
vehicles: string;
vehicles: url;
}
15 changes: 12 additions & 3 deletions src/species.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,21 @@ model Species {
/** The language commonly spoken by this species. */
language: string;

/** The URL of a planet resource, a planet that this species originates from. */
homeworld: url;

/** An array of People URL Resources that are a part of this species. */
people: url[];

/** An array of Film URL Resources that this species has appeared in. */
films: url[];

/** The hypermedia URL of this resource. */
url: string;
url: url;

/** The ISO 8601 date format of the time that this resource was created. */
created: string;
created: utcDateTime;

/** The ISO 8601 date format of the time that this resource was edited. */
edited: string;
edited: utcDateTime;
}
12 changes: 9 additions & 3 deletions src/starships.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,18 @@ model Starship {
/** The maximum length of time that this starship can provide consumables for its entire crew without having to resupply. */
consumables: string;

/** An array of Film URL Resources that this starship has appeared in. */
films: url[];

/** An array of People URL Resources that this starship has been piloted by. */
pilots: url[];

/** The hypermedia URL of this resource. */
url: string;
url: url;

/** The ISO 8601 date format of the time that this resource was created. */
created: string;
created: utcDateTime;

/** The ISO 8601 date format of the time that this resource was edited. */
edited: string;
edited: utcDateTime;
}
12 changes: 9 additions & 3 deletions src/vehicles.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ model Vehicle {
/** The maximum length of time that this vehicle can provide consumables for its entire crew without having to resupply. */
consumables: string;

/** An array of Film URL Resources that this vehicle has appeared in. */
films: url[];

/** An array of People URL Resources that this vehicle has been piloted by. */
pilots: url[];

/** The hypermedia URL of this resource. */
url: string;
url: url;

/** The ISO 8601 date format of the time that this resource was created. */
created: string;
created: utcDateTime;

/** The ISO 8601 date format of the time that this resource was edited. */
edited: string;
edited: utcDateTime;
}

0 comments on commit 5fa8c25

Please sign in to comment.