sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Incorrect resource property reference in the schema for webApiPermissionRequests

Open estruyf opened this issue 8 years ago • 12 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Following the tutorial to test out the new Graph and AAD clients (https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aad-tutorial), it mentions adding the Microsoft Graph permission scope to package-solution.json file, but the schema validation shows an error on the resource property.

screenshot 2018-02-16 09 30 15

It seems that in the current schema, the property has to be resourceId, but changing it results in a build error:

Error - Unknown
 JSON validation failed:
/v1.4.1/config/package-solution.json

Error: #/solution/webApiPermissionRequests/0
       Missing required property: resource
Error: #/solution/webApiPermissionRequests/0
       Additional properties not allowed: resourceId

Probably the schema has to get updated with the correct property name.

estruyf avatar Feb 16 '18 08:02 estruyf

The schema at https://dev.office.com/json-schemas/spfx-build/package-solution.schema.json says resourceId, which is what VSCode uses for validation, but the @microsoft/sp-build-core-tasks version of the schema says resource.

wictorwilen avatar Feb 16 '18 13:02 wictorwilen

Some extra info; the generated AppManifest.xml in the .sppkg file uses ResourceId. (and no, if you change it to resource the upload will fail with an invalid manifest error)

wictorwilen avatar Feb 16 '18 15:02 wictorwilen

Same issue, are there any workarounds? resource causes error when uploaded to app catalog and ResourceId errors on build....

CloudDesignBox avatar Feb 16 '18 16:02 CloudDesignBox

Looking into this. Can you confirm that you are running in a FirstRelease tenant (not user, but tenant)?

patmill avatar Feb 16 '18 18:02 patmill

OK. Sorted this one out. The bug got a bit confused, because it is looping in part of this bug (https://github.com/SharePoint/sp-dev-docs/issues/1365) as well. The workaround for this is "ignore the squiggles". We'll update the online json schema as soon as possible. Unfortunately that might take a bit longer than we would like.

patmill avatar Feb 16 '18 18:02 patmill

Yes, it works perfectly if you ignore the squiggly warnings in VS Code. But as you said, #1365 is what's prohibiting this now. And yes, it's a targeted release tenant

wictorwilen avatar Feb 16 '18 18:02 wictorwilen

so, considering #1365 has been resolved, you guys think that this one can be closed as well?

lucaband avatar Feb 19 '18 03:02 lucaband

It now works fine for me, although the schema still is incorrect....and wiggly lines exist but app does work in app catalog without errors.

CloudDesignBox avatar Feb 19 '18 06:02 CloudDesignBox

@lucaband - keep this until you've fixed the schema error in VS Code

wictorwilen avatar Feb 19 '18 07:02 wictorwilen

Let's keep this indeed open until we get the schema updated. Work in progress.

VesaJuvonen avatar Feb 20 '18 18:02 VesaJuvonen

Schema appears fixed... can't repo.... closing as fixed.

andrewconnell avatar Feb 01 '19 12:02 andrewconnell

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 28 '20 12:01 msft-github-bot