From 357691964787e34226fcf98eba4475fa10ad8c1a Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Wed, 1 Jan 2025 15:30:29 -0800 Subject: [PATCH 1/2] add resource reference field on paths --- aep/general/0004/aep.md.j2 | 7 +++++- aep/general/example.oas.yaml | 45 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/aep/general/0004/aep.md.j2 b/aep/general/0004/aep.md.j2 index c706c398..ac5a976a 100644 --- a/aep/general/0004/aep.md.j2 +++ b/aep/general/0004/aep.md.j2 @@ -73,7 +73,8 @@ For OpenAPI 3.0, Resources must be defined in `#components/schemas` and use the "projects/{project}/user-events/{user-event}", "folder/{folder}/user-events/{user-event}", "users/{user}/events/{user-event}" - ] + ], + "parents": ["project", "folder", "user"] } } } @@ -81,6 +82,10 @@ For OpenAPI 3.0, Resources must be defined in `#components/schemas` and use the } ``` +- If the resource has any parents, they must be specified in the parents field +using the singular name of the resource. The resource must be defined with a +`x-aep-resource` annotation. + {% endtabs %} - The `singular` field **must** be the kebab-case singular type name. diff --git a/aep/general/example.oas.yaml b/aep/general/example.oas.yaml index 75f077d4..77260194 100644 --- a/aep/general/example.oas.yaml +++ b/aep/general/example.oas.yaml @@ -354,6 +354,9 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'max_page_size', @@ -411,6 +414,9 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, ], 'responses': @@ -452,6 +458,9 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', @@ -487,6 +496,9 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', @@ -575,6 +587,9 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', @@ -611,12 +626,18 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Book' + } }, { 'name': 'max_page_size', @@ -669,12 +690,18 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Book' + } }, ], 'responses': @@ -721,12 +748,18 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Book' + } }, { 'name': 'book-edition', @@ -764,12 +797,18 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Book' + } }, { 'name': 'book-edition', @@ -801,12 +840,18 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Publisher' + } }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, + 'x-aep-resource-reference': { + 'resource': 'Book' + } }, ], 'responses': From 008004d04207509d0cccc3442d4d8b56c3163584 Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Wed, 1 Jan 2025 15:34:11 -0800 Subject: [PATCH 2/2] running prettier --- CODE_OF_CONDUCT.md | 2 +- aep/general/example.oas.yaml | 60 +++++++++--------------------------- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 406105f4..376411b2 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -89,5 +89,5 @@ of Conduct v1.3], which is adapted from the Contributor Covenant (http://contributor-covenant.org), version 2.0 available at http://contributor-covenant.org/version/2/0/code_of_conduct/ -[CNCF Community Code of Conduct v1.3]: +[cncf community code of conduct v1.3]: https://github.com/cncf/foundation/blob/main/code-of-conduct.md diff --git a/aep/general/example.oas.yaml b/aep/general/example.oas.yaml index 77260194..fcb0a826 100644 --- a/aep/general/example.oas.yaml +++ b/aep/general/example.oas.yaml @@ -354,9 +354,7 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'max_page_size', @@ -414,9 +412,7 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, ], 'responses': @@ -458,9 +454,7 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', @@ -496,9 +490,7 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', @@ -587,9 +579,7 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', @@ -626,18 +616,14 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Book' - } + 'x-aep-resource-reference': { 'resource': 'Book' }, }, { 'name': 'max_page_size', @@ -690,18 +676,14 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Book' - } + 'x-aep-resource-reference': { 'resource': 'Book' }, }, ], 'responses': @@ -748,18 +730,14 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Book' - } + 'x-aep-resource-reference': { 'resource': 'Book' }, }, { 'name': 'book-edition', @@ -797,18 +775,14 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Book' - } + 'x-aep-resource-reference': { 'resource': 'Book' }, }, { 'name': 'book-edition', @@ -840,18 +814,14 @@ 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Publisher' - } + 'x-aep-resource-reference': { 'resource': 'Publisher' }, }, { 'name': 'book', 'in': 'path', 'required': true, 'schema': { 'type': 'string' }, - 'x-aep-resource-reference': { - 'resource': 'Book' - } + 'x-aep-resource-reference': { 'resource': 'Book' }, }, ], 'responses':