Giter VIP home page Giter VIP logo

Comments (7)

pakrym-stripe avatar pakrym-stripe commented on June 18, 2024

Hi,

readOnly

There are separate schemas for resources and update parameters, you can roughly deduce what resource properties are writeable to examining an update method body.

title

Unfortunately, I do not think this is going to happen anytime soon. The API surface is very large and manually adding titles to everything is quite a bit of work.

Can you share your use case for these two sets of values?

from openapi.

jeff00seattle avatar jeff00seattle commented on June 18, 2024

@pakrym-stripe

There are separate schemas for resources and update parameters, you can roughly deduce what resource properties are writeable to examining an update method body.

Please, I would be highly interested, to clarify where are these separate schemas for resources and update parameters.

Much appreciate your response.

from openapi.

jeff00seattle avatar jeff00seattle commented on June 18, 2024

@pakrym-stripe

Can you share your use case for these two sets of values?

Working on an integration service that requires providing fields per object model (schema). The minimal field properties requirement is to provide usage expectations:

  • type
  • title -- The available field property description is too verbose, whereas title would be short and to the point.
  • readOnly

Example fields using these three field properties:

    "facebook_fans": {
        "type": "number",
        "title": "Facebook Fans",
        "readOnly": false
    },

    "expected_revenue": {
          "type": "number",
          "title": "Expected Amount",
          "readOnly": true,
          "minimum": 0,
          "maximum": 10000000000000000,
          "exclusiveMaximum": true,
          "multipleOf": "0.01"
    },

Salesforce API schema provides field properties that are applicable for title and readOnly:

{ ...subSchema, title: field.label, readOnly: !field.updateable }

HubSpot API schema provides field properties that are applicable for title and readOnly:

{ ...subSchema, title: field.label, readOnly: field.modificationMetadata.readOnlyValue }

from openapi.

pakrym-stripe avatar pakrym-stripe commented on June 18, 2024

Please, I would be highly interested, to clarify where are these separate schemas for resources and update parameters.

Let's take the account resource. The schema for the resource itself:

components:
  schemas:
    account:
      description: >-
        This is an object representing a Stripe account. You can retrieve it to ...
      properties:
        business_profile:
          anyOf:
            - $ref: '#/components/schemas/account_business_profile'
          description: Business information about the account.
          nullable: true
        business_type:
          description: The business type.
          enum:
            - company
            - government_entity
            - individual
            - non_profit
          nullable: true
          type: string
          x-stripeBypassValidation: true
        capabilities:
          $ref: '#/components/schemas/account_capabilities'

The schema for the account update parameters:

'/v1/accounts/{account}':
    post:
      description: >-
        <p>Updates a <a href="/docs/connect/accounts">connected account</a> by
        setting the values of the parameters passed. Any parameters not provided
        are

        left unchanged.</p>


        <p>For Custom accounts, you can update any information on the account.
        For other accounts, you can update all information until that

        account has started to go through Connect Onboarding. Once you create an
        <a href="/docs/api/account_links">Account Link</a>

        for a Standard or Express account, some parameters can no longer be
        changed. These are marked as <strong>Custom Only</strong> or
        <strong>Custom and Express</strong>

        below.</p>


        <p>To update your own account, use the <a
        href="https://dashboard.stripe.com/settings/account">Dashboard</a>.
        Refer to our

        <a href="/docs/connect/updating-accounts">Connect</a> documentation to
        learn more about updating accounts.</p>
      operationId: PostAccountsAccount
      parameters:
        - in: path
          name: account
          required: true
          schema:
            maxLength: 5000
            type: string
          style: simple
      requestBody:
        content:
            schema:
              additionalProperties: false
              properties:
                account_token:
                  description: >-
                    An [account
                    token](https://stripe.com/docs/api#create_account_token),
                    used to securely provide details to the account.
                  maxLength: 5000
                  type: string
                business_profile:
                  description: Business information about the account.
                  properties:
                    mcc:
                      maxLength: 4
                      type: string
                    monthly_estimated_revenue:
                      properties:
                        amount:
                          type: integer
                        currency:
                          type: string
                      required:
                        - amount
                        - currency
                      title: monthly_estimated_revenue_specs
                      type: object
                    name:
                      maxLength: 5000
                      type: string
                    product_description:
                      maxLength: 40000
                      type: string

from openapi.

jeff00seattle avatar jeff00seattle commented on June 18, 2024

@pakrym-stripe
Merry Christmas

Appreciate your response

The schema for the resource itself...

Is there a way to determine which parameters are readOnly?

The schema for the account update parameters...

There appears to be a web scraping of the HubSpot API documentation.
Is there another way to derive update parameters via another JSON file similar to spec3.json?

from openapi.

pakrym-stripe avatar pakrym-stripe commented on June 18, 2024

Is there a way to determine which parameters are readOnly?

You can tell by comparing the resource schema to update request schema. If the parameter is present in the request schema then the resource property it's writable.

from openapi.

richardm-stripe avatar richardm-stripe commented on June 18, 2024

I'm closing this ticket as "wontfix", as readOnly on a resource schema doesn't really apply to our API (as @pakrym-stripe has described) and it's unlikely that we provide "title" without more rationale/demand. We are subscribed to the issue so feel free to continue asking question -- or if anybody else reading this has a use case for these, please feel free to comment and describe.

from openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.