americanas-tech / restQL-golang

Microservice query language and platform
http://restql.b2w.io/
MIT License
17 stars 8 forks source link

feat(parser): allow paths to have collons #26

Closed wedneyyuri closed 4 years ago

wedneyyuri commented 4 years ago

Query using keys containing : (ex: zoom_rels:skus) was not working:

from skus
with product = 5664807
only _embedded.zoom_rels:skus.id

from offers
with sku = skus._embedded.zoom_rels:skus.id
only _embedded.zoom_rels:offers.id, _embedded.zoom_rels:offers.name
caiorcferreira commented 4 years ago

Nice addition, thank you!

Could you add at least one test case for this scenario?

You can add them to the ast_test.go file. You can see a sample test for variables here.

wedneyyuri commented 4 years ago

Hi @caiorcferreira, thanks for the recommendation, I'm trying to understand why it affected other test cases.

I'm not familiar with this project, can you help me understand if this is the place that needs to be changed to fix the case I created?

wedneyyuri commented 4 years ago

Made the requested changes, it's ready for review again :)

caiorcferreira commented 4 years ago

Sorry for taking so long to answer. You nailed it, the colon in the IDENT rule would conflict with the use of it as a key/value separator in an object value.

Thank you for the PR!