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

[DEVDOCS-5831/PAPI-2091]: Carts v3 and Store information V2, add store-level metafield's open api spec (#197) #199

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bc-tgomez
Copy link
Collaborator

@bc-tgomez bc-tgomez commented Mar 26, 2024

PAPI-2091 DEVDOCS-5831

What changed?

  • Store metafield's open api spec is now available in Store Information V2

Release notes draft

  • Store metafields is now available for use. Add metafield data to a merchant's store using this set of APIs. Metafields can be created, updated, and deleted on stores.

Anything else?

ping @bc-tayvs


[DEVDOCS-]

What changed?

  • Add Store metafields is now available.

Release notes draft

Anything else?

ping {names}

<!-- Ticket number or summary of work -->
# [PAPI-2091]


## What changed?
- Store metafield's open api spec

## Release notes draft
<!-- Provide an entry for the release notes using simple, conversational
language. Don't be too technical. Explain how the change will benefit
the merchant and link to the feature.

Examples:
* The newly-released [X feature] is now available to use. Now, you’ll be
able to [perform Y action].
* We're happy to announce [X feature], which can help you [perform Y
action].
* [X feature] helps you to create [Y response] using the [Z query
parameter]. Now, you can deliver [ex, localized shopping experiences for
your customers].
* Fixed a bug in the [X endpoint]. Now the [Y field] will appear when
you click [Z option]. -->
* 

## Anything else?
<!-- Add related PRs, salient notes, additional ticket numbers, etc. -->

ping 


[PAPI-2091]:
https://bigcommercecloud.atlassian.net/browse/PAPI-2091?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Tina Gomez <[email protected]>
@bc-tgomez bc-tgomez added do not merge Don't merge this work. draft labels Mar 26, 2024
@bc-tgomez bc-tgomez self-assigned this Mar 26, 2024
@bc-tgomez bc-tgomez changed the title [DEVDOCS-5831/PAPI-2091]: Carts v3 and Store information V2, add store metafield's open api spec (#197) [DEVDOCS-5831/PAPI-2091]: Carts v3 and Store information V2, add store-level metafield's open api spec (#197) Mar 26, 2024
@bc-tgomez bc-tgomez marked this pull request as ready for review March 26, 2024 21:10
@bc-tgomez bc-tgomez added ready for review This PR is complete and awaiting a review. and removed draft labels Mar 26, 2024
- Metafields
description: Gets a store `metafield`.
operationId: getStoreMetafield
responses:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
responses:
responses:

Is the response for this endpoint supposed to have a meta object?

reference/store_information.v2.yml Show resolved Hide resolved
reference/store_information.v2.yml Outdated Show resolved Hide resolved
Comment on lines +624 to +627
errors:
type: array
description: Empty for 200 responses.
example: [ ]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [spectral] reported by reviewdog 🐶
type: array must have an items sibling.

Comment on lines +688 to +694
ErrorDetail:
type: object
description: |
Error detail response payload for the BigCommerce API.
example:
"1": "Unauthorized to delete"
"2": "Metafield does not exist"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [spectral] reported by reviewdog 🐶
type: object must have a properties sibling.

Copy link
Contributor

@6juara9 6juara9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed only singular endpoints and can see some issues in each of them, do you maybe need the access to the API just to double check all possible responses 🙂 ?

application/json:
schema:
$ref: '#/components/schemas/MetaFieldCollectionResponsePartialSuccess_DELETE'
'/store/metafields/{metafieldId}':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no page, limit, key, namespace, direction params for singular get metafield endpoint.

Accept header is not really required, by default it should be application/json :)

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For get endpoint it is impossible to get the 409 :) and I'm not sure even about 422, it is just a GET, there is no input from the API client, also we don't want to document 5XX errors

image

- $ref: '#/components/parameters/MetafieldKeyParam'
- $ref: '#/components/parameters/MetafieldNamespaceParam'
- $ref: '#/components/parameters/DirectionParam'
put:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Content-Type and Accept headers are optional

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • No pagination for singular endpoint
  • 422 status is missing

image

status: 404
title: There was no metafield found with ID 1010
type: 'https://developer.bigcommerce.com/api-docs/getting-started/api-status-codes'
delete:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Accept header is not required
  • It is possible to have 404 status

image

Comment on lines +212 to +213
'500':
description: Internal Server Error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to don't document 500 errors.

- $ref: '#/components/parameters/MetafieldNamespaceInParam'
- $ref: '#/components/parameters/DirectionParam'
post:
summary: Create multiple Metafields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For store metafields we don't provide resource_id since it is metafields on store level:
Screenshot 2024-06-07 at 14 34 25

For create and update multiple metafields we don't have pagination:
Screenshot 2024-06-07 at 14 37 37

just:

"meta": {
    "total": 3,
    "success": 1,
    "failed": 2
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Don't merge this work. ready for review This PR is complete and awaiting a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants