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

make get_reference public #7515

Merged
merged 2 commits into from
Jun 6, 2022
Merged

Conversation

n2ygk
Copy link
Contributor

@n2ygk n2ygk commented Sep 3, 2020

Description

Makes schemas.openapi.get_reference public (remove the _) to complement making other methods public such as get_component_name()

@tomchristie
Copy link
Member

It's not immediately obvious to me when this'd be useful to have as public API, since it only makes sense to use if you've got references outside of the standard '$ref': '#/components/schemas/{...} space.

Are you able to provide some kind of slimmed down example that'd require this as public API?

@n2ygk
Copy link
Contributor Author

n2ygk commented Sep 3, 2020

@tomchristie

Are you able to provide some kind of slimmed down example that'd require this as public API?

I'm extending get_schema() and so far have two remaining private API calls: _get_reference and _initialise_endpoints

https://github.com/django-json-api/django-rest-framework-json-api/blob/c1ceb7f42b98ee382c11372e72933a8fbdfe9691/rest_framework_json_api/schemas/openapi.py#L547-L559

@tomchristie
Copy link
Member

Okay, so... making it public not because you want to override the behaviour in it, but rather, making it public because your implementation needs to call it? That makes sense I guess.

@n2ygk
Copy link
Contributor Author

n2ygk commented Sep 3, 2020 via email

@n2ygk
Copy link
Contributor Author

n2ygk commented Sep 29, 2020

@tomchristie should this be in milestone 3.13 and/or labeled schema generation?

@n2ygk
Copy link
Contributor Author

n2ygk commented May 17, 2021

@carltongibson perhaps you can review this and put it on Tom's queue for 3.13?

@stale
Copy link

stale bot commented Apr 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 28, 2022
@n2ygk
Copy link
Contributor Author

n2ygk commented Apr 28, 2022

This stalebot stuff makes me sad that I wasted effort on submitting PRs.

@stale stale bot removed the stale label Apr 28, 2022
@tomchristie
Copy link
Member

This seems reasonable enough, yes.

@tomchristie tomchristie merged commit 563a20a into encode:master Jun 6, 2022
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants