Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Composite PK support #117

Open
razvanphp opened this issue Nov 16, 2022 · 2 comments
Open

Composite PK support #117

razvanphp opened this issue Nov 16, 2022 · 2 comments

Comments

@razvanphp
Copy link

Hey @cebe, thank you for this great library.

We started using the generator and want to develop the missing features and push some PRs.

Can you please point us in the right direction with this? What/where to look for PK array definition, we saw some comments in the code and assumed this implementation is trickier since it was left out ob purpose, but still, we need it and want to contribute.

Cheers,
R

@cebe
Copy link
Owner

cebe commented Nov 17, 2022

Hi @razvanphp,

thanks for offering your help. I think we did not implement it because it was not needed. We can add it if we find good use cases for composite PK. However we are trying to follow the JSON API Standard as much as possible and it does not seem to define how to handle composite PKs, at least I did not find it. https://jsonapi.org/format/#document-resource-object-identification

How would your OpenAPI description, which defines an entity with composite PK look like and how should the API Requests/Responses handle the composite PK?

@cebe cebe moved this to 🆕 New in yii2-openapi Project Jan 27, 2023
@cebe cebe moved this from 🆕 New to 📋 Backlog in yii2-openapi Project Jan 27, 2023
@cebe
Copy link
Owner

cebe commented Jan 27, 2023

Related to #135 if you want to define a composite PK for the database only, that should definitively be possible even though we have no way to express this relation at the API itself.

@razvanphp could you please share some details about your use case?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: 🔢 Concept Needed
Development

No branches or pull requests

2 participants