-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Open
lolodomo
wants to merge
6
commits into
openhab:main
Choose a base branch
from
lolodomo:generate_dsl
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lolodomo
force-pushed
the
generate_dsl
branch
12 times, most recently
from
January 25, 2025 10:14
521b446
to
2ce9669
Compare
Here is an example of result for things:
and the same in flat mode:
|
And the result for items:
|
lolodomo
force-pushed
the
generate_dsl
branch
2 times, most recently
from
January 25, 2025 13:38
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. |
lolodomo
force-pushed
the
generate_dsl
branch
from
January 26, 2025 10:27
c3d70dc
to
6bc963f
Compare
Problem with items sorting is solved. So ready again. |
lolodomo
force-pushed
the
generate_dsl
branch
from
January 26, 2025 10:38
6bc963f
to
16bcb14
Compare
Related to openhab#4509 Added REST APIs: - GET /inbox/{thingUID}/filesyntax to generate file syntax for the thing associated to the discovery result - GET /items/filesyntax to generate file syntax for all items - GET /items/{itemname}/filesyntax to generate file syntax for an item - GET /things/filesyntax to generate file syntax for all things - GET /things/{thingUID}/filesyntax to generate file syntax for a thing All these APIs have a parameter named "format" to request a particular output format. Of course, a syntax generator should be available for this format. Only "DSL" format is provided by this PR as this is currently our unique supported format for items and things in config files. So this parameter is set to "DSL" by default. In the future, new formats could be added and they will be automatically supported by these APIs. The API GET /things/filesyntax has another parameter named "preferPresentationAsTree" allowing to choose between a flat display or a display as a tree. Its default value is true for a display of things as tree. Signed-off-by: Laurent Garnier <[email protected]>
lolodomo
force-pushed
the
generate_dsl
branch
from
January 26, 2025 17:56
16bcb14
to
3c2f376
Compare
Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Laurent Garnier <[email protected]>
lolodomo
force-pushed
the
generate_dsl
branch
from
January 30, 2025 21:46
52ce3b9
to
506527b
Compare
Signed-off-by: Laurent Garnier <[email protected]>
Each API has a 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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #4509
Added REST APIs:
All these APIs have a parameter named "format" to request a particular output format. Of course, a syntax generator should be available for this format. Only "DSL" format is provided by this PR as this is currently our unique supported format for items and things in config files. So this parameter is set to "DSL" by default. In the future, new formats could be added and they will be automatically supported by these 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.
The API GET /things/filesyntax has another parameter named "preferPresentationAsTree" allowing to choose between a flat display or a display as a tree. Its default value is true for a display of things as tree.