Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add resource reference field on paths #256

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion aep/general/0004/aep.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ 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"]
}
}
}
}
}
```

- 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.
rambleraptor marked this conversation as resolved.
Show resolved Hide resolved

{% endtabs %}

- The `singular` field **must** be the kebab-case singular type name.
Expand Down
15 changes: 15 additions & 0 deletions aep/general/example.oas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
'in': 'path',
'required': true,
'schema': { 'type': 'string' },
'x-aep-resource-reference': { 'resource': 'Publisher' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these files are autogenerated now. I think you should modify aep-lib-go to add the new field: https://github.com/aep-dev/aep-lib-go/blob/main/pkg/api/openapi.go#L326. Or file an issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this file autogenerated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's a PR documenting it! #258. Since I'm sure it'll come up a lot.

},
{
'name': 'max_page_size',
Expand Down Expand Up @@ -411,6 +412,7 @@
'in': 'path',
'required': true,
'schema': { 'type': 'string' },
'x-aep-resource-reference': { 'resource': 'Publisher' },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'x-aep-resource-reference': { 'resource': 'Publisher' },
'x-aep-resource-reference': { 'resource': 'publisher' },

same with the others - we use lower kebab case.

},
],
'responses':
Expand Down Expand Up @@ -452,6 +454,7 @@
'in': 'path',
'required': true,
'schema': { 'type': 'string' },
'x-aep-resource-reference': { 'resource': 'Publisher' },
},
{
'name': 'book',
Expand Down Expand Up @@ -487,6 +490,7 @@
'in': 'path',
'required': true,
'schema': { 'type': 'string' },
'x-aep-resource-reference': { 'resource': 'Publisher' },
},
{
'name': 'book',
Expand Down Expand Up @@ -575,6 +579,7 @@
'in': 'path',
'required': true,
'schema': { 'type': 'string' },
'x-aep-resource-reference': { 'resource': 'Publisher' },
},
{
'name': 'book',
Expand Down Expand Up @@ -611,12 +616,14 @@
'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',
Expand Down Expand Up @@ -669,12 +676,14 @@
'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':
Expand Down Expand Up @@ -721,12 +730,14 @@
'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',
Expand Down Expand Up @@ -764,12 +775,14 @@
'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',
Expand Down Expand Up @@ -801,12 +814,14 @@
'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':
Expand Down
Loading