The first if in setHeaders() returns early without any headers, if options.headers is falsy - what is always the case when the options object is empty itself. So the default "Accept" header will not be set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
schemaAnalyzer.resolveSchemaParameters() calls schema.getParameters() without options argument (which defaults to {})
https://github.com/api-platform/admin/blob/ab9239cc0b750ad9339de0bc856031b0da47dc38/src/introspection/schemaAnalyzer.ts#L14:L16
From now on the empty options object gets passed getParameters() -> fetchResource() -> fetchJsonLd() -> setHeaders()
api-doc-parser/src/hydra/getParameters.ts
Line 10 in 1f6772b
https://github.com/api-platform/api-doc-parser/blob/1f6772b96936030ea4308efd04d0f69de5a24482/src/hydra/fetchResource.ts#L9:L13
api-doc-parser/src/hydra/fetchJsonLd.ts
Line 30 in 1f6772b
The first if in setHeaders() returns early without any headers, if options.headers is falsy - what is always the case when the options object is empty itself. So the default "Accept" header will not be set.
https://github.com/api-platform/api-doc-parser/blob/1f6772b96936030ea4308efd04d0f69de5a24482/src/hydra/fetchJsonLd.ts#L64:L66