You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A microservices app generated based on the sample jdl microservice-ecommerce-store.jdl does not load the Swagger UI under Administration -> API . Two changes were made to the sample JDL (build tool was changed to maven and docker deployment added). The gateway and microservices are running fine using docker compose with entities being created.
relationship OneToOne {
Customer{user(login) required} to User with builtInEntity
}
relationship ManyToOne {
OrderItem{product(name) required} to Product
}
relationship OneToMany {
Customer{order} to ProductOrder{customer(email) required},
ProductOrder{orderItem} to OrderItem{order(code) required} ,
ProductCategory{product} to Product{productCategory(name)}
}
service Product, ProductCategory, Customer, ProductOrder, OrderItem with serviceClass
paginate Product, Customer, ProductOrder, OrderItem with pagination
/* Entities for Invoice microservice */
entity Invoice {
code String required
date Instant required
details String
status InvoiceStatus required
paymentMethod PaymentMethod required
paymentDate Instant required
paymentAmount BigDecimal required
}
jamie87u7
changed the title
Swagger UI does not load while using a sample jdl with JWT authentication
Swagger UI does not load while using JWT authentication
Mar 7, 2024
Overview of the issue
A microservices app generated based on the sample jdl microservice-ecommerce-store.jdl does not load the Swagger UI under Administration -> API . Two changes were made to the sample JDL (build tool was changed to maven and docker deployment added). The gateway and microservices are running fine using docker compose with entities being created.
The browser (chrome on windows) throws two errors
There seems to be no Authorization headers set. Swagger UI works when the authentication type is set to oauth2 in the same JDL
Motivation for or Use Case
To use the swagger ui
Reproduce the error
jhipster jdl jhipster-jdl.jdl --monorepository --workspaces
./mvnw -ntp -Pprod verify jib:dockerBuild
Related issues
Possibly #5501
Suggest a Fix
Total JHipster newbie here. Looking at related issues and their fixes
JHipster Version(s)
8.1.0
JHipster configuration
JDL
*/
application {
config {
baseName store
applicationType gateway
packageName com.jhipster.demo.store
serviceDiscoveryType consul
authenticationType jwt
prodDatabaseType mysql
cacheProvider no
buildTool maven
clientFramework react
testFrameworks [cypress]
reactive true
}
entities *
}
application {
config {
baseName invoice
applicationType microservice
packageName com.jhipster.demo.invoice
serviceDiscoveryType consul
authenticationType jwt
prodDatabaseType mysql
buildTool maven
serverPort 8081
skipUserManagement true
}
entities Invoice, Shipment
}
application {
config {
baseName notification
applicationType microservice
packageName com.jhipster.demo.notification
serviceDiscoveryType consul
authenticationType jwt
databaseType mongodb
prodDatabaseType mongodb
devDatabaseType mongodb
cacheProvider no
enableHibernateCache false
buildTool maven
serverPort 8082
skipUserManagement true
}
entities Notification
}
/* Entities for Store Gateway */
/** Product sold by the Online store */
entity Product {
name String required
description String
price BigDecimal required min(0)
productSize Size required
image ImageBlob
}
enum Size {
S, M, L, XL, XXL
}
entity ProductCategory {
name String required
description String
}
entity Customer {
firstName String required
lastName String required
gender Gender required
email String required pattern(/^[^@\s]+@[^@\s]+.[^@\s]+$/)
phone String required
addressLine1 String required
addressLine2 String
city String required
country String required
}
enum Gender {
MALE, FEMALE, OTHER
}
entity ProductOrder {
placedDate Instant required
status OrderStatus required
code String required
invoiceId Long
}
enum OrderStatus {
COMPLETED, PENDING, CANCELLED
}
entity OrderItem {
quantity Integer required min(0)
totalPrice BigDecimal required min(0)
status OrderItemStatus required
}
enum OrderItemStatus {
AVAILABLE, OUT_OF_STOCK, BACK_ORDER
}
relationship OneToOne {
Customer{user(login) required} to User with builtInEntity
}
relationship ManyToOne {
OrderItem{product(name) required} to Product
}
relationship OneToMany {
Customer{order} to ProductOrder{customer(email) required},
ProductOrder{orderItem} to OrderItem{order(code) required} ,
ProductCategory{product} to Product{productCategory(name)}
}
service Product, ProductCategory, Customer, ProductOrder, OrderItem with serviceClass
paginate Product, Customer, ProductOrder, OrderItem with pagination
/* Entities for Invoice microservice */
entity Invoice {
code String required
date Instant required
details String
status InvoiceStatus required
paymentMethod PaymentMethod required
paymentDate Instant required
paymentAmount BigDecimal required
}
enum InvoiceStatus {
PAID, ISSUED, CANCELLED
}
entity Shipment {
trackingCode String
date Instant required
details String
}
enum PaymentMethod {
CREDIT_CARD, CASH_ON_DELIVERY, PAYPAL
}
relationship OneToMany {
Invoice{shipment} to Shipment{invoice(code) required}
}
service Invoice, Shipment with serviceClass
paginate Invoice, Shipment with pagination
microservice Invoice, Shipment with invoice
/* Entities for notification microservice */
entity Notification {
date Instant required
details String
sentDate Instant required
format NotificationType required
userId Long required
productId Long required
}
enum NotificationType {
EMAIL, SMS, PARCEL
}
microservice Notification with notification
deployment {
deploymentType docker-compose
serviceDiscoveryType consul
appsFolders [store, invoice, notification]
}
.yo-rc.json file
.yo-rc.json file for store
.yo-rc.json file for invoice
.yo-rc.json file for notification
Environment and Tools
openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Zulu21.30+15-CA (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Zulu21.30+15-CA (build 21.0.1+12-LTS, mixed mode, sharing)
git version 2.42.0.windows.2
node: v20.10.0
npm: 10.2.3
Docker version 25.0.3, build 4debf41
Chrome Version 121.0.6167.189 (Official Build) (64-bit)
Windows 11
The text was updated successfully, but these errors were encountered: