Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "DromedaryCase" bug: myaggregateId GOOD, myAggregateId BAD #9

Closed
robertreppel opened this issue Apr 14, 2018 · 2 comments
Closed
Assignees

Comments

@robertreppel
Copy link
Contributor

robertreppel commented Apr 14, 2018

CamelCase doesn't work; it assumes that the 'I' in "Id" at the end of aggregate/stream id parameters and properties is the only uppercase char. Fails without les validate error and results in broken les-node API code.

For example: inventoryitemId vs. inventoryItemId

This works:

Receive Product-> // productId, description
InventoryItem Stocked // inventoryitemId, sku, description, purchasePrice, quantityAvailable
InventoryitemLookup* // inventoryitemId, productId, description

This passes les validate but results in a broken les-node -b API:

Receive Product-> // productId, description
InventoryItem Stocked // inventoryItemId, sku, description, purchasePrice, quantityAvailable
InventoryitemLookup* // inventoryItemId, productId, description

only one hump

@robertreppel robertreppel added the help wanted Extra attention is needed label Apr 14, 2018
@mohkami
Copy link
Contributor

mohkami commented May 21, 2018

I'm not quite sure what should be the expected behaviour here.
On this line, we are explicitly making sure that we are changing letters to lower case:
https://github.com/Adaptech/les/blob/master/pkg/convert/emdToEml.go#L300

//Ensure consistent casing for stream Ids: e.g. TimesheetHoursId is represented as "timesheethoursId".

If we want to keep the property's name in the case it is, we just need to change the next line (301) to the following:
event.Event.Properties[index].Name = parameter.Name[:len(parameter.Name)-2] + "Id"

@robertreppel
Copy link
Contributor Author

Yes, but if I recall correctly there are side effects caused by this elsewhere in the code. I'll take a look and try it out.

@robertreppel robertreppel removed the help wanted Extra attention is needed label May 21, 2018
@robertreppel robertreppel self-assigned this May 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants