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

Configurable field for API Identification #24

Open
nandoan opened this issue Mar 23, 2021 · 10 comments
Open

Configurable field for API Identification #24

nandoan opened this issue Mar 23, 2021 · 10 comments

Comments

@nandoan
Copy link

nandoan commented Mar 23, 2021

Using the API title (extracted from the Openapi specification) is not the best option in some scenarios. When a developer makes a correction to the title this plugin creates a new API in Drupal portal because it is unable to find the existent one.

It would be nice to have an optional parameter to define witch field must be used as the API ID. With this change, after creating a custom field in Drupal and populating it using the apicatalog-config.json:

{
   ...
   "fields":{
      ...
      "field_api_id": "internal-api-id",
   }
}

And the apigee-smartdocs-maven-plugin could be changed to use this field to locate the existent API instead of the title.

pom.xml

...
<profile>
	<id>dev</id>
	<properties>
		...
		<portal.api.id.field>field_api_id</portal.api.id.field>
	</properties>
</profile>
...

Ideally, the default behavior (when the new parameter isn't supplied) should be the current one: the title is used as the identifier.

@ssvaidyanathan
Copy link
Collaborator

will look into it. For now, you can get this to work by running delete and create options so that it doesn't create a new spec altogether

nandoan added a commit to nandoan/apigee-smartdocs-maven-plugin that referenced this issue Mar 24, 2021
@nandoan nandoan mentioned this issue Mar 24, 2021
@nandoan
Copy link
Author

nandoan commented Mar 25, 2021

Thant you for the fast answer. I've submitted a pull request with a implementation proposal.

@ssvaidyanathan
Copy link
Collaborator

will take a look

@nandoan
Copy link
Author

nandoan commented Jun 15, 2021

Hi @ssvaidyanathan.
Do you have any update about this issue?
Thank you.

@ssvaidyanathan
Copy link
Collaborator

@giteshk - what do you think of this PR? Need your help reviewing this

@giteshk
Copy link
Member

giteshk commented Jun 15, 2021

I like the idea.
I will try to setup a portal and see if the filtering is working as expected.
@nandoan you may need to rebase your commit with the latest changes.

@giteshk
Copy link
Member

giteshk commented Jun 15, 2021

Can you also update the https://github.com/apigee/apigee-smartdocs-maven-plugin/blob/master/samples/Drupal8/DevPortal/pom.xml file with the proposed field change and set the default to title

@nandoan
Copy link
Author

nandoan commented Jun 16, 2021

@giteshk
I've updated the branch with the latest changes and added the default field setting

@giteshk
Copy link
Member

giteshk commented Jun 18, 2021

I have verified the jsonapi endpoint and it works as expected.
@ssvaidyanathan Can we review the PR ?

@giteshk giteshk linked a pull request Jun 18, 2021 that will close this issue
@ssvaidyanathan
Copy link
Collaborator

@nandoan - Thanks for the contribution

I have reviewed the code and provided some feedback. Please take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants