How can I change the layout of the swagger-ui? - springdoc

How can I change the layout of the swagger-ui?
For layout options, you can use swagger-ui configuration options. What does this mean?
For example:
springdoc.swagger-ui.layout=BaseLayout
What all are the different options available ?

Layouts are a special type of component that Swagger UI uses as the root component for the entire application. You can define custom layouts in order to have high-level control over what ends up on the page.
By default, Swagger UI uses BaseLayout, which is built into the application. You can specify a different layout to be used by passing the layout's name as the layout parameter to Swagger UI.
There is also StandaloneLayout, or you can add you custom layout if necessary:
https://github.com/swagger-api/swagger-ui/blob/master/docs/customization/custom-layout.md

Related

Is it possible to use the vaadin-grid inside a LitElement of a Polymer application?

What is the minimum example, if any, using the Polymer PWA (https://polymer.github.io/pwa-starter-kit/), to show correctly a vaadin-grid?
I tried many different combinations, but never a working one, with, often, this warning:
property-accessors.js:275 Polymer::Attributes: couldn't decode Array as JSON
Am I doing anything totally wrong?
Thanks
Andrea
Starting from the v5.2.0-beta1 we recommend using following Grid features:
column helper elements (vaadin-grid-filter-column, vaadin-grid-sort-column)
column convenience properties (path, header and text-align)
renderers for more complex cases where you previously used templates
See the example here: https://glitch.com/edit/#!/lying-blanket?path=app.js:29:42
https://lying-blanket.glitch.me/
Note: I'm using fetch API here for simplicity only, you can use XHR if necessary.

Attribute binding vs property binding for Component's string #Input properties in Angular?

To set string #Input() properties of the component, we can use two type of syntax:
<my-component caption="Hello there" type="primary" someThing="text value"></my-component>
OR:
<my-component [caption]="'Hello there'" [type]="'primary'" [someThing]="'text value'"></my-component>
I'm fully aware of the differences between those two types of bindings. The question is: If I have bunch of string #Input() properties that I want to set statically, can I use simple attribute binding syntax (first example) than more "meaty" property binding syntax (second example)?
What is the recommendation, and why? I.e. what are the trade-offs and is it preferable to use property-binding always, even for setting static string inputs?
Here are the few drawbacks I can think of:
Attribute bindings are actually applied as HTML attributes, and e.g.
user can see/alter them via browser's dev tools easily. Property
bindings are not part of the markup.
Attribute bindings might collide
with actual HTML attribute names (unless you prefix them with data-
which defeats the whole purpose of simplicity). Actual example that
already bit me is title attribute.
There is no intellisense in markup for attribute bindings with Angular Language Service.
But the major advantage is the simplicity. In the example above, you would agree that the first form is more elegant. In my projects it seems that big number of properties are constant (one-time-set) string properties, and the syntax makes actual difference in readability.
So... Is it a bad practice to use attribute-binding syntax for custom (non-HTML) string properties? (Given the fact that I'm aware/ok with above listed few limitations)
These are a couple of things I like to add:
Attributes are just plain static fields.
There is a fine line when attributes become properties.
Simplicity is not the goal here, modularity and reuse-ability is.
Property binding give you more control in your component and you can use a component in any like any data-driven or static scenario.
One component build right with property binding can be used in 20 different projects.
But if you got no such requirement then you can use attributes. They are fine.
I will not say which one is better, both have their use cases but overall property bindings are lot more powerful and flexible.
And last thing I like to mention for all readers:
In front-end development any one can modify the code. We use
validations just to provide a smooth user experience. Other than that
any one can get the code or alter HTML if they want to, that's why we
use server side validations. Angular pipe line is complex but
hack-able. A user can wrap a JSON object and send it to server
bypassing all our validations. So for all readers who are new front-end
devs, we don't bother too much about security, we try our best to give
a good user experience.

Polymer and globals

I'm getting into Polymer and i like the deps resolution approach using imports.
And i like the extending capability through the behaviors config.
However, there's something that doesn't feel comfortable to me, about behaviors in particular.
Looking at the PolymerElements code i see that behaviors, are defined inside their own html in the global object Polymer and then referenced directly when imported by another component..
For example:
paper-button imports paper-button-behavior
https://github.com/PolymerElements/paper-button/blob/master/paper-button.html#L14
it then defines paper-button-behavior as behavior referencing from global Polymer.PaperButtonBehavior
https://github.com/PolymerElements/paper-button/blob/master/paper-button.html#L144
wich is defined here (the imported html)
https://github.com/PolymerElements/paper-behaviors/blob/master/paper-button-behavior.html#L49
Ain't it an anti-pattern, especially as typically an app will not use Polymer's world exclusively?

.NET MVC 4.5 - Section not defined

I'm rendering a Razor template and would like to define sections, to which I'm able to add content throughout all included pages (namely, javascripts).
However, all sections so far have come up as empty. If I set them to required: true, I get the error that the section has not been defined. To test this, I added the following code to my main template file:
#section foo {
<p>Hello</p>
}
#RenderSection("foo", true)
These lines are right on top of each other. The rendering of the template fails with the message Section not defined: "foo".
Given that the section is obviously defined, did I maybe miss something in the Project configuration or Controller to enable support for sections? All other #commands (like #RenderBody())inside the template seem to work fine, so some support for the Razor commands is clearly present.
It looks like you're defining your section and trying to render it from your shared layout. As I understand it, you need to call RenderSection in your shared layout and then define the section it your views that use that shared layout.
This link from Scott Gu is a pretty good reference for sections:
MVC 3 Layouts & Sections

remove document tab shown in avalondock

My application does not have multiple documents. So I do not need the tab shown in LayoutDocumentPane. I found that it can be customized by using style here. http://avalondock.codeplex.com/wikipage?title=Document%20tab%20restyling
But it seems to be over complicated. Is there any simple way of doing this ?
If you don't need multiple documents, you probably don't need documents at all. You should put your content in a normal dockable panel.
In AvalonDock 2.x you could use LayoutAnchorable and in 1.x use DockableContent, both nested in suitable containers of course.
In avalondock 1.x there is a property that does just what you need. Its called DocumentPane.ShowHeader.
It does not (yet?) exist on 2.x
If you want to modify avalondock to do what you need, I submitted a patch to the project that adds the feature.
Its included in this ticket: http://avalondock.codeplex.com/workitem/15626