Skip to content

Commit

Permalink
feat: add structured references
Browse files Browse the repository at this point in the history
With references becoming an integral part of our multi-tenant API, we need separate messages to properly model stuff like:
- multi tenant domains
- relative paths
- absolute paths
- link attributes (`rel`, `target`, ..)
  • Loading branch information
thisismana committed Sep 24, 2024
1 parent 106d03d commit a6de6ff
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions stroeer/core/v1/article.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ option go_package = "github.com/stroeer/go-tapir/core/v1;core";
* | `entities` | `string` `[deprecated]` | Extracted entities from the article body like persons, locations, organizations etc. `deprecated` — use `keywords` instead. |
* | `authors` | `repeated` [`Author`][author] | Authors and or Agencies ƒor this content | |
* | `related_articles` | `repeated Article` | Editorial articles, which are related to the main article. May only be an empty unresolved article (not all services will resolve these). |
* | `references` | `repeated` [`Reference`](reference.html)[] | References, e.g. URLs belonging to this article. |
*
* [t]: #enum-type
* [b]: article_%DB%B0_body.html
Expand Down Expand Up @@ -76,6 +77,7 @@ message Article {
map<string, Article> variants = 11;
repeated Author authors = 12;
repeated Article related_articles = 13;
repeated Reference references = 14;
repeated string entities = 100 [deprecated = true];

/** @CodeBlockEnd */
Expand Down Expand Up @@ -497,11 +499,12 @@ message Article {
* An asset configuration is dependant upon its use, it may alter depending
* on its [`type`](#enum-type) field.
*
* | Field name | Type | Description |
* |------------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
* | `type` | [`Type`][at] | Type of the asset. |
* | `fields` | `map<string, string>` | Generic map containing general content and configuration information of the asset. Clients must be resilient to unknown or missing entry sets. |
* | `metadata` | [`Metadata`][meta] | Only present for `assets` of `TYPE.METADATA`. Technical metadata for the parent `element` (state, validity, ...). See [`Metadata`][meta] |
* | Field name | Type | Description |
* |-------------|----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
* | `type` | [`Type`][at] | Type of the asset. |
* | `fields` | `map<string, string>` | Generic map containing general content and configuration information of the asset. Clients must be resilient to unknown or missing entry sets. |
* | `metadata` | [`Metadata`][meta] | Only present for `assets` of `TYPE.METADATA`. Technical metadata for the parent `element` (state, validity, ...). See [`Metadata`][meta] |
* | `reference` | [`Reference`](reference.html) | Reference, e.g. URL belonging to this asset. |
*
* [at]: #enum-type
* [meta]: article_%3E_metadata.html
Expand All @@ -512,6 +515,7 @@ message Article {
Type type = 1;
map<string, string> fields = 2;
Metadata metadata = 3;
Reference reference = 4;
/** @CodeBlockEnd */

/**
Expand Down Expand Up @@ -715,6 +719,7 @@ message Article {
map<string, string> fields = 3;
repeated BodyNode children = 4;
repeated Element elements = 5;
Reference reference = 6;
}
/** @CodeBlockEnd */
/**
Expand All @@ -739,7 +744,7 @@ message Article {
* | `p` | `paragraph` / `<p>` |
* | `span` | `<span>` |
* | `sub_headline` | a sub headline, may be part of the _table of contents_ |
* | `a` | `anchor` / `<a>` |
* | `a` | `anchor` / `<a>`, link target can be found in the `repeated Reference[]` structure |
* | `strong` | `strong` / `<strong>` |
* | `em` | `emphasis` / `<em>` |
* | `sub` | `subscript` / `sub` |
Expand Down

0 comments on commit a6de6ff

Please sign in to comment.