Skip to content

Adding embed domains#1

Closed
sublet wants to merge 2 commits intoDocSpring:masterfrom
sublet:master
Closed

Adding embed domains#1
sublet wants to merge 2 commits intoDocSpring:masterfrom
sublet:master

Conversation

@sublet
Copy link
Copy Markdown

@sublet sublet commented Apr 14, 2021

Works with updating a template, and when creating a PDF.

@sublet sublet changed the title [WIP] Adding embed domains Adding embed domains Apr 15, 2021
@ndbroadbent
Copy link
Copy Markdown
Member

ndbroadbent commented Mar 22, 2022

Hi @sublet, thanks for your PR, and sorry it took me so long to look at this! As you can see, we use OpenAPI Generator to automatically generate each of these client libraries, so unfortunately I'm not able to merge PRs, because any changes will get overwritten whenever we update our OpenAPI schema and need to re-generate the new API client code.

However, I can see that you just needed to access some additional fields on the template, particularly: embed_domains, fields, shared_field_data.

Our API schema tests did include a version of the Template model that had the full list of available properties, but unfortunately this model was hidden away with the very confusing name Template1.

I've been able to correct this issue by giving this model a proper title: FullTemplate, which you can now find here: https://github.com/DocSpring/docspring-javascript/blob/main/src/model/FullTemplate.js

As you can see, it has the full list of configurable properties, and all the properties that are returned when you pass in ?full=true. So in your code, instead of using the Template model, you may be able to create a FullTemplate model when building the API request.

I also saw this change:

      let url = '/templates/{template_id}'
      if (opts && opts['full']) {
        url = '/templates/{template_id}?full=true'
      }

      var authNames = ['api_token_basic'];
      var contentTypes = [];
      var accepts = ['application/json'];
      var returnType = Template;

      return this.apiClient.callApi(
        url, 'GET',
        pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
        authNames, contentTypes, accepts, returnType, callback
      );

We actually do provide a getFullTemplate function that you can call for this purpose. Unfortunately it will be difficult to incorporate your change here, but you should be able to switch to using the getFullTemplate function to achieve the same result.

I hope this helps, and please let me know if you have any more feedback!

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 this pull request may close these issues.

2 participants