Comments (7)
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.
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.
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 propertydescription
is too verbose, whereastitle
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.
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.
@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.
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.
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)
- `POST /v1/ephemeral_keys` is missing the `verification_session` property HOT 2
- Add support for the new Tax Calculations HOT 1
- Chitwad
- Add license to info block
- BETA Money Movement APIs HOT 1
- Missing BETA issuing APIs HOT 1
- POST /v1/subscriptions missing a required parameter? HOT 8
- GET /v1/terminal/readers missing preview param `serial_number` HOT 4
- recursion between file and file_link HOT 2
- Plan in subscription object HOT 1
- Automatic pulling latest spec3.json per new Stripe OpenAPI release? HOT 2
- miss error invalid_bank_account_iban\invalid_owner_name HOT 5
- Frontier Climate: a bug report HOT 1
- `refunds` on `charge` is marked as required, but is not included in all requests HOT 3
- Update to Documentation HOT 1
- Retrieve events by related_object=<customer id> HOT 2
- Order Return Object has Disappeared HOT 2
- Question about subscription item quantity set to 0 HOT 1
- Spec3.json with Swagger UI - Out of Memory error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi.