Open HangyiWang opened 3 months ago
Hello @HangyiWang,
This issue is due to imprecision in one of the heuristics in RESTler for identifying dependencies. If these names should simply be arbitrary strings, adding the following to the dictionary should resolve the incorrect dependencies in the grammar (or adding a custom payload generator for the strings if the names must be unique):
"restler_custom_payload": {
"/properties/datasets/[0]/name": ["any", "string"],
"/properties/status/datasets/[0]/name": ["any", "string"]
},
Unfortunately, this same imprecision could impact new APIs with a similar naming pattern in the body and those new properties would need to be added similarly to the above. (Please keep this issue open to track improving the dependency analysis to fix the root cause).
Thanks,
Marina
Thanks!
Description
When I run
restler compile
to generate grammar files, it creates a wrong dynamic dependency on one of the API requests so restler has to create another unrelated resource before that request.Steps to reproduce
This is the partial resource definitions for my
PUT /api/assets/{assetName}
.I also have another path called
PUT /api/datasets/{datasetName}
, which does nothing with the assets API.But in assets request in
grammar.py
, I saw_api_datasets__datasetName__put_name.reader()
which comes from the dataset creation API. Look at thename
underdatasetConfiguration
. It should be a simple string.If I remove
/api/datasets/{datasetName}
in my swagger input, restler generates correct file.And I didn't set any producer/consumer relationships in my annotation file.
Expected results
_api_datasets__datasetName__put_name.reader()
should be a simple fuzz string.Actual results
_api_datasets__datasetName__put_name.reader()
comes from a wrong restler logic?Environment details