Comments (2)
Expanding on this a little bit.
Right now we're allowing only alphanumeric characters and .
in the interface name.
To be precise, we're matching the interface name against this regex:
~r/^[a-zA-Z]+(\.[a-zA-Z0-9]+)*$/
Since CQL only accepts alpha-numeric characters and underscores in table names, and since sometimes the interface name has to be mapped onto a table name, we deal with it here mainly by lowercasing everything and replacing .
with _
(plus a bunch of extra stuff that is not relevant here).
The point is, if we allow using also -
in the interface name, we mainly have two choices when we have to map the interface name to a table: either we replace also -
with .
or we drop it alltogether.
The first will cause conflicts between, e.g., com.my.pretty.Interface
and com.my-pretty.Interface
, the second will cause will cause conflicts between, e.g., com.my.PrettyInterface
and com.my.Pretty-Interface
.
Whichever way we decide to go, this has to be documented.
from astarte_core.
These are the examples we used to validate the regular expression for interface_name
OK:
JustInterfaceName1
JustInterfaceName
justinterfacename
com.astarte-platform.InterfaceName1
com.astarte-platform.InterfaceName
com.astarte-platform.interfacename
a.InterfaceName
com.a.InterfaceName
com.0.aa
aaa.a-.aaaaa
c0m.InterfaceName
Shouldn't be ok, but we are accepting it anyway:
com.a-.interfacename
Not ok:
com.-.InterfaceName
c-m.InterfaceName
a-.a
c-o-m.astarte-platform.interfacename
1JustInterfaceName
just-interface-name
com.astarte-platform.InterfaceName-
com.astarte-platform.InterfaceName.
-a.a
0.test.InterfaceName
0.InterfaceName
-
.
-.
from astarte_core.
Related Issues (8)
- Invalid overlapping endpoints HOT 1
- Add additional checks to interface changeset HOT 1
- Interface changeset crashes if `endpoint` is not present in a mapping HOT 1
- CI cleanup
- database_retention_ttl validation should be ignored if database_retention_policy == no_ttl
- SimpleEvents.Encoder.extract_bson_value does not support an empty binary
- Question/Bug: database default ttl for database retention with use_ttl policy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astarte_core.