Uncertainty on when invoice.subscription is to be expanded.

Open
#61 12 comments 0 reactions 1 assignee View on GitHub

@richardm-stripe is already working on this.

Since Sep 10, 2020.

Assessment

This issue has not been assessed yet.

Description

future

Hi there!
I'm wrapping my head around x-expandableFields and x-expansionResources. I thought I got this right but there's a case that confuses me.
Let's take invoice.subscription. it's not an expandableFIeld and it's still anyOf(str, ref(subscription)). So far, every time I get an invoice, I see the subscription automatically expanded. So my questions are:

  • can subscription in this case come un-expanded and just as a string?
  • is there any way of controlling this behavior?
    I notice that the field is hinted with an x-expansionResources, which if I understand correctly, hints that the id form of this field is a reference to the indicated (subscription) resource. I'm just unsure if I'm missing something here.

My intention is to reduce the type ambiguity of the return types, so consumers don't need to check whether -- in this case -- the subscription is an id or the actual object. I can deal with expandableFields most of the times, but this one seems off.

Thank you!!

Dominant language
No language data
Stars
503
Forks
148
Avg merge
6d 14m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stripe/openapi

All issues in stripe/openapi

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.