-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
[REST] New REST APIs to generate DSL syntax for items and things #4569
base: main
Are you sure you want to change the base?
Conversation
521b446
to
2ce9669
Compare
Here is an example of result for things:
|
And the result for items:
|
cff0a29
to
c3d70dc
Compare
@kaikreuzer and @openhab/core-maintainers : for your information, the PR is now ready for review. |
Go back to draft as I discovered a bug. |
c3d70dc
to
6bc963f
Compare
Problem with items sorting is solved. So ready again. |
52ce3b9
to
506527b
Compare
4c78817
to
8970628
Compare
Related to openhab#4509 Added REST APIs: - GET /file-format/existing/items to create file format for all existing items in registry - GET /file-format/existing/item/{itemname} to create file format for an existing item in registry - GET /file-format/existing/things to create file format for all existing things in registry - GET /file-format/existing/thing/{thingUID} to create file format for an existing thing in registry - GET /file-format/existing/thing-from-inbox/{thingUID} to create file format for an existing thing in discovey registry All these APIs have a boolean parameter named "hideDefaultParameters" to hide or show the configuration parameters having the default value. They are hidden by default. Signed-off-by: Laurent Garnier <[email protected]>
4c70810
to
9740ead
Compare
I was certainly too much ambitious when I decided to try also covering #4585 in this PR. As a consequence, the PR is smaller and ready for review. @kaikreuzer : that would be great if you could have a look. For #4585, another PR will be created based on this one. |
I don't know if I should or not keep the "language" parameter as it is not used by these APIs. |
I agree, not used at this time, so not needed. In the future, when we would support e.g. a YAML format format as well, we can still introduce it with a default value equal to I would be keen to try to create a proper documentation of the generated response, rather than just |
Language parameter is to provide a locale, not to select the output format. I will remove the language parameter. |
I will first check if it makes sense to get a localized version of a thing/item before generating DSL syntax. |
Oops, sorry, of course. I was mixing up things. |
...core/src/main/java/org/openhab/core/io/rest/core/internal/fileformat/FileFormatResource.java
Outdated
Show resolved
Hide resolved
If you are interested, the code to convert to YAML is working in the prototype I created, and could easily be integrated here. See https://github.com/mherwege/openhab-core/tree/yaml |
....core.model.item/src/org/openhab/core/model/item/internal/syntax/DslItemSyntaxConverter.java
Outdated
Show resolved
Hide resolved
This PR introduces nothing related to YAML. |
Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Laurent Garnier <[email protected]>
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
Signed-off-by: Laurent Garnier <[email protected]>
application/vnd.openhab-dsl is renamed into either application/vnd.aopenhab.dsl.item or application/vnd.openhab.dsl.thing Signed-off-by: Laurent Garnier <[email protected]>
0848af6
to
3b4942f
Compare
For information, I changed media types from application/vnd.openhab-dsl into application/vnd.openhab.dsl.item and application/vnd.openhab.dsl.thing. |
Signed-off-by: Laurent Garnier <[email protected]>
3b4942f
to
4d6c7ba
Compare
Related to #4509
Added REST APIs:
All these APIs have a boolean parameter named "hideDefaultParameters" to hide or show the configuration parameters having the default value. They are hidden by default.