Browse Source
			
			
			Feature/improve detection of json used via scraper configuration (#3539)
			
				* Improve detection of json
* Update changelog
			
			
				pull/3534/head^2
			
			
		 
		
			
				
					
						
						Chang-Yen Tseng
					
					1 year ago
					
						
							committed by
							
								
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 2 changed files with 
7 additions and 
1 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
 
			
				- 
					
					
					 
					apps/api/src/services/data-provider/manual/manual.service.ts
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | 
					 | 
					 | 
					The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | 
					 | 
					 | 
					and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					## Unreleased | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					### Changed | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					- Improved the detection of REST APIs (`JSON`) used via the scraper configuration | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					## 2.92.0 - 2024-06-30 | 
					 | 
					 | 
					## 2.92.0 - 2024-06-30 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					### Added | 
					 | 
					 | 
					### Added | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -257,7 +257,7 @@ export class ManualService implements DataProviderInterface { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        signal: abortController.signal | 
					 | 
					 | 
					        signal: abortController.signal | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }); | 
					 | 
					 | 
					      }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					      if (headers['content-type'] === 'application/json') { | 
					 | 
					 | 
					      if (headers['content-type'].includes('application/json')) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        const data = JSON.parse(body); | 
					 | 
					 | 
					        const data = JSON.parse(body); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        const value = String( | 
					 | 
					 | 
					        const value = String( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          jsonpath.query(data, scraperConfiguration.selector)[0] | 
					 | 
					 | 
					          jsonpath.query(data, scraperConfiguration.selector)[0] | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |