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

Error while creating ApiDoc with api_products in payload through JSONAPI #878

Closed
shishir-intelli opened this issue Jun 9, 2023 · 7 comments · Fixed by #879 or #896
Closed

Error while creating ApiDoc with api_products in payload through JSONAPI #878

shishir-intelli opened this issue Jun 9, 2023 · 7 comments · Fixed by #879 or #896
Labels
bug Something isn't working

Comments

@shishir-intelli
Copy link
Collaborator

Description

Adding api_products to API doc through JSONAPI throwing error
No ID specified for related resource

Steps to Reproduce

Steps to reproduce the behavior:
Create API doc by using Jsonapi, in request payload add api_products.

Actual Behavior

No ID specified for related resource

Expected Behavior

Add ApiDoc with api products successfully

Notes

This issue is coming when using https://github.com/apigee/apigee-smartdocs-maven-plugin
Original Issue - apigee/apigee-smartdocs-maven-plugin#55

@shishir-intelli shishir-intelli added the bug Something isn't working label Jun 9, 2023
@ssvaidyanathan
Copy link

do we have an ETA?

@shishir-intelli
Copy link
Collaborator Author

@ssvaidyanathan
We are working on new feature releases for ApigeeX and Drupal 10 releases for all the modules.
We have planned to work on this issue in Q3.

@ssvaidyanathan
Copy link

Can this be expedited as we have customers affected due to this issue

@shishir-intelli
Copy link
Collaborator Author

Certainly, We will prioritize this as soon as we release ApigeeX and Drupal10 new features.

@shishir-intelli shishir-intelli transferred this issue from apigee/apigee-api-catalog-drupal Jul 6, 2023
@shishir-intelli
Copy link
Collaborator Author

@ssvaidyanathan ,
PR #879 resolves the Internal server error issue when trying to get the api-products through JSONAPI (/jsonapi/api_product/api_product)

The request payload to pass the api product while creating an API node is:

"relationships": {
    "field_api_product": {
        "data": [
              {
                "type":"api_product--api_product",
                 "id": "XXXXXX" //pass the uuid here
             }
        ]
    },
}

@ssvaidyanathan
Copy link

@shishir-intelli - you mentioned //pass the uuid here. Which uuid should I be passing if its a create operation?

@shishir-intelli
Copy link
Collaborator Author

shishir-intelli commented Jul 12, 2023

@shishir-intelli - you mentioned //pass the uuid here. Which uuid should I be passing if its a create operation?

It is api_product uuid
Sample response for /jsonapi/api_product/api_product :
image

To create a API doc with api_products by using JSONAPI:
Sample request pay load:

{
    "data": {
        "type": "node--apidoc",
        "attributes": {
            "status": true,
            "title": "Test API Doc",
            "body": {
                "value": "<p>Lorem ipsum...</p>",
                "format": "basic_html",
                "processed": "<p>Lorem ipsum...</p>",
                "summary": null
            },
            "field_apidoc_file_link": {
                "uri": "https://github.com/apigee/apigee-smartdocs-maven-plugin/blob/master/samples/Drupal8/DevPortal/specs/Petstore.yaml"
            },
            "field_apidoc_spec_file_source": "url"
        },
        "relationships": {
            "field_api_product": {
                "data": [
                    {
                        "type":"api_product--api_product",
                        "id": "tester"
                    },                    
                    {
                        "type":"api_product--api_product",
                        "id": "pingstatus-v1-product-test-operations"
                    }
                ]
            }
        }
    }
}

After executing the above JSON request payload, Test API Doc API Doc with api_product information will be created in Drupal portal,
Screenshot:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants